#<Bundler :: RubygemsIntegration:0x00005633f09a9000>的未定义方法'plain_specs'(NoMethodError)


13

我已经完成了一个工作项目,当我尝试运行该项目时rails db:migrate,终端要求安装“ Bundler 2”,因此我可以这样做。

现在,当我尝试执行此操作时rails db:migrate,出现以下错误:

/home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:84:in `setup': undefined method `plain_specs' for #<Bundler::RubygemsIntegration:0x00005633f09a9000> (NoMethodError)
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:124:in `check'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/rubygems-bundler-1.4.5/lib/rubygems-bundler/noexec.rb:131:in `<top (required)>'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:168:in `require'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:168:in `rescue in require'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/site_ruby/2.4.0/rubygems/core_ext/kernel_require.rb:178:in `require'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/rubygems-bundler-1.4.5/lib/rubygems_executable_plugin.rb:4:in `block in <top (required)>'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/executable-hooks-1.5.0/lib/executable-hooks/hooks.rb:50:in `block in run'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/executable-hooks-1.5.0/lib/executable-hooks/hooks.rb:49:in `each'
    from /home/acartesc/.rvm/rubies/ruby-2.4.3/lib/ruby/gems/2.4.0/gems/executable-hooks-1.5.0/lib/executable-hooks/hooks.rb:49:in `run'
    from /home/acartesc/.rvm/gems/ruby-2.4.3/bin/ruby_executable_hooks:10:in `<main>'

我感谢您的帮助!


该问题似乎与此处描述的问题类似:stackoverflow.com/questions/24833123/…可通过重新生成binstub来解决。
sergio

重新生成垃圾桶没有帮助。我将捆绑程序降级为2.0.2,现在一切正常。我猜这是bundler 2.1.0的错误?
Aetherus

Answers:


14
gem uninstall rubygems-bundler

对我有用,我正在使用捆绑器2.1.0

参考:https : //github.com/bundler/bundler/issues/7492

显示时

ERROR:  While executing gem ... (Gem::InstallError)
    rubygems-bundler is not installed in GEM_HOME, try:
    gem uninstall -i /Users/xxxx/.rvm/rubies/ruby-2.5.7/lib/ruby/gems/2.5.0 rubygems-bundler

请跑

gem uninstall -i /Users/xxxx/.rvm/rubies/ruby-2.5.7/lib/ruby/gems/2.5.0 rubygems-bundler

0

您的红宝石版本是什么?我有同样的问题。

我的红宝石版本是2.6.3,我的捆绑包在此红宝石版本中不起作用。(捆绑包已升级到2.0.2),

因此,我将捆绑软件降级为Verion 1.17.3,它可以正常工作。

我用这个解决方案将为您提供帮助。


0

确保您使用的是支持的红宝石版本。尝试使用时遇到了这个问题jruby-9.2.9。通过从jruby切换到ruby,问题解决了。

rvm use ruby-2.5.1

0

捆绑器版本存在错误 2.1.0.pre.2

我取消捆绑器gem的安装,并安装了不同版本的捆绑器gem

$ gem uninstall bundler
$ gem install bundler -v 2.0.2

它应该工作。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.