REE rake gems:安装无法正常工作

发布于 2024-11-03 18:56:07 字数 401 浏览 0 评论 0原文

我在 CentOS 5 上安装了 REE 来执行一项非常特殊的任务(使用 Rails 2.3.10 和 ruby​​ 1.8),我真的需要将它隔离

在这种情况下,我不会使用捆绑器或其他东西。

如果我通过手动设置每个gem,一切都会正常

/opt/ree/bin/gem install agem

但是当我

/opt/ree/bin/rake gems:install

准备好这个命令项目时 - 所有(或大多数,我没有检查每个依赖项)gem都通过 /usr/bin/gem 安装到公共gem路径中,我不需要其中任何一个

这是一个问题,我不想手动安装所有宝石。有中小企业遇到过这个问题并且可能知道解决方案吗?

I've installed REE on CentOS 5 for a very special task (using rails 2.3.10 and ruby 1.8) and I really need it to be isolated

In this case I won't use bundler or smth so.

Everything works ok if I'll setup every gem manually via

/opt/ree/bin/gem install agem

But when I run

/opt/ree/bin/rake gems:install

in prepared for this command project - all (or most, I haven't check every dependency) gems are installed via /usr/bin/gem into common gem path, where I do not need any of them

This is an issue and I do not want to install all gems manually. Have smb ever hit into this issue and probably knows solution?

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

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

发布评论

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

评论(2

断桥再见 2024-11-10 18:56:07

真正帮助我的解决方案是暂时用 /opt/ree/bin/gem 的符号链接替换 ​​/usr/bin/gem

替换为 /opt /ree/bin/rake gems:intall 按预期工作 - 所有必需的 gem 都安装到 REE 路径 - 将 /usr/bin/gem 返回到原始 gem 可执行文件使系统再次稳定

这是不是很干净的解决方案但它确实有效,所以在危急情况下它可以像锤子一样使用。

Solution that really helped me was to temporarily replace /usr/bin/gem with a symbolic link to /opt/ree/bin/gem

With this replacement /opt/ree/bin/rake gems:intall worked as expected - all required gems were installed to REE path - returning /usr/bin/gem to original gem executable made system stable again

This is not very clean solution but it works, so it can be used like hammer in critical situation.

作妖 2024-11-10 18:56:07

环境中某处存在 GEM_HOME 变量,或者调用的运行时 ruby​​ 不是 ree。因此,我建议至少尝试 3 件事:

  • 从一个几乎空的环境开始(例如运行 env -i sh )并再次运行 rake 命令,看看这是否仍然安装 gems共同的宝石路径。请小心,因为 env -i 是一个空环境,您可能会看到来自 ruby​​gems 的抱怨(因为没有设置 HOME 或其他任何内容)...
  • 检查 shebang 行(rake 程序的第一行)确实表示您的 REE 二进制文件,而不是其他东西
  • 最后,使用 REE 二进制文件与 /opt/ree/bin/ruby /opt/ree/bin/rake gems:install< 运行 rake /code>

这应该给你一个指示出了什么问题。总而言之,我认为环境问题可能是这件事最有可能的罪魁祸首

There's either a GEM_HOME variable somewhere in the environment, or the runtime ruby called is not ree. Therefore, I'd suggest at least 3 things to try:

  • Start with an almost empty environment (run env -i sh for example) and run again the rake command, see if this is still installs gems in the common gem path. Be careful, because env -i is an empty environment, you might see complaints from rubygems (because no HOME or nothing else is set)...
  • Check that the shebang line (first line of the rake program) really indicates your REE binary and not something else
  • Finally, do run rake using the REE binary with /opt/ree/bin/ruby /opt/ree/bin/rake gems:install

This should give you an indication of what's going wrong. All in all, I think that the environment issue is probably the most probable culprit of this thing

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