使用Ruby企业版,gem没有安装在我所期望的地方 [英] Using Ruby Enterprise Edition, gems are not installed where I would expect
问题描述
我刚刚安装了Ruby Enterprise Edition,并为它安装了一些宝石。股票Ruby 1.8.6也安装在服务器上。
我添加了 /opt/ruby-enterprise-1.8.6-20090201/bin 到我的
PATH
/ usr / bin
的头部,其中 ruby
和 gem
live。
code>证实了这一点:
/opt/ruby-enterprise-1.8.6-20090201/bin/gem $ c $但是,当我安装像这样的宝石:
gem install some_gem
它们最终位于 /usr/lib/ruby/gems/1.8/gems /
而不是 /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems /
。
但是如果我使用 /opt/ruby-enterprise-1.8.6-20090201/bin/gem install some_gem
它 进入REE的gem目录。
我不明白。有一些配置选项,我必须改变?我 在这里使用sudo。也许这跟它有关系?
这里有一个很好的解释:
这里假设你使用的是Ubuntu。 sudo确实改变了ubuntu下的路径。
/ usr / bin /中的gem可能是/usr/bin/gem1.8的符号链接。我做的是符号链接ruby-enterprise的gem到/ usr / bin / ree-gem,像这样: sudo ln -s /opt/ruby-enterprise-1.8.6 -20090201 / bin / gem / usr / bin / ree-gem
然后我只用:
sudo ree-gem安装some_gem
专门为ree安装gem。如果你没有使用ruby 1.8.6 rubygem,你可以将REE的gem链接到/ usr / bin / gem中: -enterprise-1.8.6-20090201 / bin / gem / usr / bin / gem
I have just installed Ruby Enterprise Edition and am installing some gems for it. Stock Ruby 1.8.6 is also installed on the server.
I have added /opt/ruby-enterprise-1.8.6-20090201/bin
to my PATH
a head of /usr/bin
where ruby
and gem
live.
which gem
confirms this:
/opt/ruby-enterprise-1.8.6-20090201/bin/gem
However, when I install gems like this:
gem install some_gem
They end up in /usr/lib/ruby/gems/1.8/gems/
instead of /opt/ruby-enterprise-1.8.6-20090201/lib/ruby/gems/1.8/gems/
.
But if I use /opt/ruby-enterprise-1.8.6-20090201/bin/gem install some_gem
it does go into REE's gem directory.
I don't get it. Is there some config option I have to change? I am using sudo here. Maybe that has something to do with it?
There's a good explanation of what's going on here:
This assumes you're using Ubuntu. sudo does change the path under ubuntu.
The gem you have in /usr/bin/ is probably a symlink to /usr/bin/gem1.8. What I did was symlink ruby-enterprise's gem to /usr/bin/ree-gem like this:
sudo ln -s /opt/ruby-enterprise-1.8.6-20090201/bin/gem /usr/bin/ree-gem
then I just use:
sudo ree-gem install some_gem
to install gems specifically for ree. If you're not using the ruby 1.8.6 rubygem, you can symlink REE's gem to /usr/bin/gem instead:
sudo ln -s /opt/ruby-enterprise-1.8.6-20090201/bin/gem /usr/bin/gem
这篇关于使用Ruby企业版,gem没有安装在我所期望的地方的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!