6

如果我不是描述性的,这里的第一次问题请原谅我。运行带有 rails 2.3.5 的 Ruby 1.8.7 如果我运行任何 rails 或 rake 任务,我会得到

/home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup': undefined method `name' for #<Array:0x7f45a2fe73a8> (NoMethodError)
    from /home/mathew/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `map'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `each'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `map'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:75:in `setup'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:114:in `check'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems-bundler/noexec.rb:121
    from /home/mathew/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from /home/mathew/.rvm/rubies/ruby-1.8.7-p374/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/rubygems-bundler-1.4.2/lib/rubygems_executable_plugin.rb:4
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:50:in `call'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:50:in `run'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:49:in `each'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@global/gems/executable-hooks-1.2.6/lib/executable-hooks/hooks.rb:49:in `run'
    from /home/mathew/.rvm/gems/ruby-1.8.7-p374@wholesale/bin/ruby_executable_hooks:10

我的宝石清单是:

*** LOCAL GEMS ***

actionmailer (2.3.5)
actionpack (2.3.5)
activerecord (2.3.5)
activeresource (2.3.5)
activesupport (2.3.5)
atomic (1.1.14)
bcrypt-ruby (3.1.2)
bundler (1.3.5)
bundler-unload (1.0.2)
daemons (1.0.10)
delayed_job (2.0.4)
executable-hooks (1.2.6)
hpricot (0.8.4)
i18n (0.6.5, 0.5.0)
json (1.8.1)
minitest (4.7.5)
multi_json (1.8.2)
mysql (2.8.1)
nokogiri (1.4.1)
rack (1.5.2, 1.0.1)
rails (2.3.5)
rake (10.1.0, 0.9.2.2)
rdoc (4.0.1)
rubygems-bundler (1.4.2)
rubygems-update (2.1.10, 1.8.25)
rvm (1.11.3.8)
thread_safe (0.1.3)
tzinfo (0.3.38)

从我读过的内容来看,bcrypt-ruby 和 bundler 不能很好地结合在一起。所以我尝试卸载 bundler 和 ruby​​gems-bundler (因为 ruby​​gems-bundler 在错误输出中)但是当我运行 gem list 时它们似乎没有被卸载:/ 任何帮助将不胜感激。谢谢!

4

2 回答 2

9

似乎与以下内容重复:Rails 2.3.14 not working,答案是:Remove bundle from global gemset

$ rvm @global
$ gem uninstall bundler
于 2013-11-13T12:58:37.670 回答
2

对于那些来自搜索引擎的人:就我而言,使用 ruby​​gems 3.1.1 和 bundler 2.1.0,问题仍然是安装了 ruby​​gems-bundler。

Traceback (most recent call last):
    6: from /Users/myuser/.rvm/gems/ruby-2.6.3@timing/bin/ruby_executable_hooks:10:in `<main>'
    5: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
    4: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
    3: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
    2: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
    1: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- rubygems-bundler/noexec (LoadError)
    10: from /Users/myuser/.rvm/gems/ruby-2.6.3@timing/bin/ruby_executable_hooks:10:in `<main>'
     9: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `run'
     8: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:49:in `each'
     7: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/executable-hooks-1.6.0/lib/executable-hooks/hooks.rb:50:in `block in run'
     6: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
     5: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:156:in `require'
     4: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
     3: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/site_ruby/2.6.0/rubygems/core_ext/kernel_require.rb:168:in `require'
     2: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:131:in `<top (required)>'
     1: from /Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:124:in `check'
/Users/myuser/.rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:84:in `setup': undefined method `plain_specs' for #<Bundler::RubygemsIntegration:0x00007f90bf0cb3e8> (NoMethodError)

调查这种情况,自述文件有这样的说法:

通常,在 RubyGems >= 2.2.0 上不需要这个 gem。

解决方案是从@globalgemset 中删除该 gem:

rvm @global
gem uninstall rubygems-bundler
于 2019-12-17T06:42:37.597 回答