在生成Rails脚手架等基本问题上遇到了臭名昭著的must use Bundler 2 or greater
错误。而且,与大多数提出的问题相反,他没有雇用Heroku;这是在本地开发机器上。
这种方式尽管发生
gem 'bundler', '~> 2.0', '>= 2.0.2'
在宝石文件中指定了。
运行一个干净的石板,然后退后一会...
gem uninstall bundler
> Successfully uninstalled bundler-1.17.3
> Successfully uninstalled bundler-2.0.2
gem install bundler -v 1.17.3
> Successfully installed bundler-1.17.3
bundle -v
> Bundler version 1.17.3
但是添加到Gemfile中时
gem 'bundler', '~> 1.17', '>= 1.17.3'
由RubyGems site建议,然后重新运行
bundle install
[...]
Gemfile.lock签署
BUNDLED WITH
1.17.3
开始运营
rails g scaffold Idioma code nome
返回
/Users/main/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/bundler-1.17.3/lib/bundler/runtime.rb:319:in `check_for_activated_spec!':
You have already activated bundler 1.17.3,
but your Gemfile requires bundler 1.17.2.
Prepending `bundle exec` to your command may solve this. (Gem::LoadError)
嗯?
这是怎么回事?为什么捆包机感到困惑并扩大了这种困惑?