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.
我刚刚安装了Ruby Enterprise Edition并正在为它安装一些gems。在服务器上也安装了Ruby 1.8.6库存。
I have added /opt/ruby-enterprise-1.8.6-20090201/bin
to my PATH
a head of /usr/bin
where ruby
and gem
live.
我在我的路径上增加了/opt/ruby-enterprise 1.8.6-20090201/bin一个ruby和gem所在的/usr/bin的负责人。
which gem
confirms this:
这宝石证实了这一点:
/opt/ruby-enterprise-1.8.6-20090201/bin/gem
/ opt / ruby -企业- 1.8.6 - 20090201 / bin /宝石
However, when I install gems like this:
然而,当我安装这样的宝石:
gem install some_gem
gem安装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/
.
它们以/usr/lib/ruby/gems/1.8/而不是/opt/ruby-企业-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.
但是如果我使用/opt/ruby-enterprise 1.8.6-20090201/bin/gem安装some_gem,它就会进入REE的gem目录。
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?
我不明白。是否有一些配置选项需要修改?我用的是sudo。也许这和它有关?
5 个解决方案
#1
12
There's a good explanation of what's going on here:
这里有一个很好的解释
sudo改变路径-为什么?
This assumes you're using Ubuntu. sudo does change the path under ubuntu.
假设你在使用Ubuntu。sudo改变了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:
你在/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 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
sudo ree-gem安装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:
专门为ree安装宝石。如果你没有使用ruby 1.8.6 rubygem,你可以将REE的gem链接到/usr/bin/gem中:
sudo ln -s /opt/ruby-enterprise-1.8.6-20090201/bin/gem /usr/bin/gem
sudo ln -s /opt/ruby-enterprise 1.8.6-20090201/bin/gem /usr/bin/gem
#2
0
A solution I used to a similar problem is to set up an alias to your REE gem command.
我使用的一个解决类似问题的方法是为REE gem命令设置一个别名。
I.e.
即。
alias reegem='/opt/ruby-enterprise-1.8.6-20090201/bin/gem'
#3
0
I posted the solution I used on Ubuntu here: http://groups.google.com/group/emm-ruby/browse_thread/thread/d0c685bbd096823a#msg_effa7d6ad42c541c
我在这里发布了我在Ubuntu上使用的解决方案:http://groups.google.com/group/emm- ruby/browse_thread/d0c685bbd096823a # msg_effa7d62c541c
There were some additional steps to get it working beyond what was described in the Ruby Enterprise Edition documentation.
除了Ruby企业版文档中所描述的之外,还有一些其他的步骤可以让它工作。
#4
0
Here's an explanation for why it's setup like this for REE: http://www.rubyenterpriseedition.com/documentation.html#_how_ree_installs_itself_into_the_system
这里有一个对REE的解释:http://www.rubyenterpriseedition.com/document.html #_how_ree_installs_itself_into_the_system
#5
0
In addition to Jack Chu's helpful symlink above, might I suggest:
除了上面提到的Jack Chu的帮助符号,我还可以建议:
sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/ree-rake
sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/ree-rake
so you can sudo ree-rake gems:install
所以你可以使用sudo ree-rake gem:install
#1
12
There's a good explanation of what's going on here:
这里有一个很好的解释
sudo改变路径-为什么?
This assumes you're using Ubuntu. sudo does change the path under ubuntu.
假设你在使用Ubuntu。sudo改变了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:
你在/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 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
sudo ree-gem安装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:
专门为ree安装宝石。如果你没有使用ruby 1.8.6 rubygem,你可以将REE的gem链接到/usr/bin/gem中:
sudo ln -s /opt/ruby-enterprise-1.8.6-20090201/bin/gem /usr/bin/gem
sudo ln -s /opt/ruby-enterprise 1.8.6-20090201/bin/gem /usr/bin/gem
#2
0
A solution I used to a similar problem is to set up an alias to your REE gem command.
我使用的一个解决类似问题的方法是为REE gem命令设置一个别名。
I.e.
即。
alias reegem='/opt/ruby-enterprise-1.8.6-20090201/bin/gem'
#3
0
I posted the solution I used on Ubuntu here: http://groups.google.com/group/emm-ruby/browse_thread/thread/d0c685bbd096823a#msg_effa7d6ad42c541c
我在这里发布了我在Ubuntu上使用的解决方案:http://groups.google.com/group/emm- ruby/browse_thread/d0c685bbd096823a # msg_effa7d62c541c
There were some additional steps to get it working beyond what was described in the Ruby Enterprise Edition documentation.
除了Ruby企业版文档中所描述的之外,还有一些其他的步骤可以让它工作。
#4
0
Here's an explanation for why it's setup like this for REE: http://www.rubyenterpriseedition.com/documentation.html#_how_ree_installs_itself_into_the_system
这里有一个对REE的解释:http://www.rubyenterpriseedition.com/document.html #_how_ree_installs_itself_into_the_system
#5
0
In addition to Jack Chu's helpful symlink above, might I suggest:
除了上面提到的Jack Chu的帮助符号,我还可以建议:
sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/ree-rake
sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/ree-rake
so you can sudo ree-rake gems:install
所以你可以使用sudo ree-rake gem:install