我已经提取了一个工作中的项目,当我尝试运行rails db:migrate
时,终端请求安装“捆绑软件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>'
感谢您的帮助!
答案 0 :(得分:13)
gem uninstall rubygems-bundler
为我工作 我正在使用捆绑器2.1.0
REF: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
答案 1 :(得分:0)
您的红宝石版本是什么?我遇到了同样的问题。
我的红宝石版本为2.6.3
,我的捆绑包在此红宝石版本中不起作用。
(捆绑包已升级到2.0.2
),
因此,我将捆绑软件降级为版本1.17.3
,它可以正常工作。
使用此解决方案的我将为您提供帮助。
答案 2 :(得分:0)
确保使用的是支持的红宝石版本。尝试使用jruby-9.2.9
时遇到了这个问题。通过从jruby切换到ruby,问题解决了。
rvm use ruby-2.5.1
答案 3 :(得分:0)
这是捆绑软件版本2.1.0.pre.2
的错误
我没有安装捆绑软件gem,并安装了不同版本的捆绑软件
$ gem uninstall bundler
$ gem install bundler -v 2.0.2
应该可以。
答案 4 :(得分:-3)
我也遇到了这些错误。对我来说,解决方法是将Chrome版本升级到最新版本。现在,不再有错误。