解析多个版本的rubygems

解析多个版本的rubygems,第1张

概述我有什么看起来像我的机器上安装的多个版本的 rubygems,当我的宝石列表我看到我的所有宝石,但当我去运行脚本,我收到错误消息,如 Missing these required gems: SystemTimer 是否有任何方法可以删除所有版本的rubygems而不是一个?理想情况下,我希望能够访问我的程序中出现在宝石列表下的所有宝石. 来自宝石环境        – RUBY EXECUT 我有什么看起来像我的机器上安装的多个版本的 rubygems,当我的宝石列表我看到我的所有宝石,但当我去运行脚本,我收到错误消息,如

Missing these required gems:  SystemTimer

是否有任何方法可以删除所有版本的rubygems而不是一个?理想情况下,我希望能够访问我的程序中出现在宝石列表下的所有宝石.

来自宝石环境
       – RUBY EXECUtable:/System/library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby

如果我跑:

$/System/library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby script/mailer_daemon_fetcher start productionno such file to load -- SystemTimer/library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'/library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'/library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencIEs.rb:156:in `require'/library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencIEs.rb:521:in `new_constants_in'/library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencIEs.rb:156:in `require'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:208:in `load'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `each'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:164:in `process'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'./script/../config/environment.rb:13script/mailer_daemon_fetcher:5:in `require'script/mailer_daemon_fetcher:5no such file to load -- SystemTimer/library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'/library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'/library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencIEs.rb:156:in `require'/library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencIEs.rb:521:in `new_constants_in'/library/Ruby/Gems/1.8/gems/activesupport-2.3.4/lib/active_support/dependencIEs.rb:156:in `require'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb:208:in `load'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `each'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:307:in `load_gems'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:169:in `process'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `send'/library/Ruby/Gems/1.8/gems/rails-2.3.4/lib/initializer.rb:113:in `run'./script/../config/environment.rb:13script/mailer_daemon_fetcher:5:in `require'script/mailer_daemon_fetcher:5Missing these required gems:  SystemTimer  You're running:  ruby 1.8.7.72 at /System/library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby  rubygems 1.3.5 at /System/library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8,/library/Ruby/Gems/1.8

请注意上面我手动调用ruby ** / System / library / Frameworks / Ruby.framework / Versions / 1.8 /usr/bin/ruby​​ **这是我的/usr/bin/ruby​​符号链接到的文件,我的GEM_PATH也设置为/System/library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8

宝石环境的完整输出可在此处获取:http://pastie.org/661104

@R_502_6120@ 我觉得你可能使用的不同版本的ruby比ruby宝石更多.无论是ruby还是ruby都不知道在哪里寻找你的宝石.

请参阅gem installation guide以确保您的环境配置为使用gem.

如果您在按照说明 *** 作后仍然遇到问题,请确保您没有安装多个版本的ruby.如果有多个版本的Ruby可用,请确保您的脚本调用与gem相同的Ruby版本.这是通过将RUBY_EXECUtable的gem环境列表与脚本的shebang行进行比较来完成的.仔细检查以遵循任何符号链接,因为大多数基于分发的ruby安装会将/usr/bin/ruby​​符号链接到/usr/bin/ruby1.8

您还应该检查您的gem是否由运行该脚本的同一用户安装.

如果您在没有root权限的情况下运行gem install,则新gem将安装在您的主目录中.如果您正在运行依赖于这些gem作为另一个用户的脚本.那些已安装的宝石将无法找到.但是,如果您的gem由root用户安装并且另一个用户正在运行需要这些gem的脚本,则没有问题.

我从Ruby转向Ruby Enterprise Edition时遇到了这个问题.我发现我必须使用REE的gem实例再次安装我所需的所有宝石.

总结

以上是内存溢出为你收集整理的解析多个版本的rubygems全部内容,希望文章能够帮你解决解析多个版本的rubygems所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/langs/1288144.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-09
下一篇 2022-06-09

发表评论

登录后才能评论

评论列表(0条)

保存