REE rake gems:安装无法正常工作
我在 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
真正帮助我的解决方案是暂时用
/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 againThis is not very clean solution but it works, so it can be used like hammer in critical situation.
环境中某处存在
GEM_HOME
变量,或者调用的运行时 ruby 不是 ree。因此,我建议至少尝试 3 件事:env -i
是一个空环境,您可能会看到来自 rubygems 的抱怨(因为没有设置HOME
或其他任何内容).../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: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, becauseenv -i
is an empty environment, you might see complaints from rubygems (because noHOME
or nothing else is set).../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