使用 Ruby Enterprise Edition,gems 没有安装在我期望的位置

发布于 2024-07-14 08:50:53 字数 737 浏览 11 评论 0原文

我刚刚安装了 Ruby Enterprise Edition,并正在为其安装一些 gem。 服务器上还安装了 Stock Ruby 1.8.6。

我已将 /opt/ruby-enterprise-1.8.6-20090201/bin 添加到我的 PATH/usr/bin 头,其中 < code>ruby 和 gem 已上线。

which gem 确认了这一点:

/opt/ruby-enterprise-1.8.6-20090201/bin/gem

但是,当我像这样安装 gem 时:

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。 也许这有什么关系?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(5

烟酒忠诚 2024-07-21 08:50:53

这里有一个很好的解释:

sudo 更改 PATH - 为什么?

这假设你'正在使用 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

then我只是使用:

sudo ree-gem install some_gem

专门为 ree 安装 gem。 如果您不使用 ruby​​ 1.8.6 ruby​​gem,则可以将 REE 的 gem 符号链接到 /usr/bin/gem:

sudo ln -s /opt/ruby-enterprise-1.8.6-20090201/bin/gem /usr/垃圾箱/宝石

There's a good explanation of what's going on here:

sudo changes PATH - why?

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

月棠 2024-07-21 08:50:53

我用于解决类似问题的解决方案是为 REE gem 命令设置别名。

IE

alias reegem='/opt/ruby-enterprise-1.8.6-20090201/bin/gem'

A solution I used to a similar problem is to set up an alias to your REE gem command.

I.e.

alias reegem='/opt/ruby-enterprise-1.8.6-20090201/bin/gem'
羁〃客ぐ 2024-07-21 08:50:53

我在这里发布了我在 Ubuntu 上使用的解决方案:
http://groups.google.com/group/emm- ruby/browse_thread/thread/d0c685bbd096823a#msg_effa7d6ad42c541c

除了 Ruby Enterprise Edition 文档中描述的内容之外,还需要一些额外的步骤才能使其正常工作。

I posted the solution I used on Ubuntu here:
http://groups.google.com/group/emm-ruby/browse_thread/thread/d0c685bbd096823a#msg_effa7d6ad42c541c

There were some additional steps to get it working beyond what was described in the Ruby Enterprise Edition documentation.

羁拥 2024-07-21 08:50:53

除了上面 Jack Chu 有用的符号链接之外,我可以建议:

sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/ree-rake

这样你就可以 sudo ree-rake gems:install

In addition to Jack Chu's helpful symlink above, might I suggest:

sudo ln -s /opt/ruby-enterprise/bin/rake /usr/bin/ree-rake

so you can sudo ree-rake gems:install

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文