我无法投放bundle update devise
或bundle install
$ bundle update devise
Fetching gem metadata from http://rubygems.org/.............
Fetching gem metadata from http://rubygems.org/..
Resolving dependencies............
Fetching rake 12.3.0 (was 10.1.0)
Installing rake 12.3.0 (was 10.1.0)
Gem::RuntimeRequirementNotMetError: rake requires Ruby version >= 2.0.0. The current ruby version is 1.9.1.
An error occurred while installing rake (12.3.0), and Bundler cannot continue.
Make sure that `gem install rake -v '12.3.0'` succeeds before bundling.
这就是我$ bundle install
Fetching gem metadata from http://rubygems.org/.............
Fetching gem metadata from http://rubygems.org/..
You have requested:
devise = 2.2.4
The bundle currently has devise locked at 3.1.0.
Try running `bundle update devise`
If you are updating multiple gems in your Gemfile at once,
try passing them all to `bundle update`
提前致谢
答案 0 :(得分:0)
从给定的日志跟踪中,您似乎已在gemfile中为版本指定了2.2.4版本。
只需从gemfile中删除该版本,然后运行bundle update,rubygems本身将根据ruby版本找到依赖的gem版本并将其锁定为gemfile.lock。
答案 1 :(得分:0)
问题在于您的Devise Gem被锁定到特定版本,这就是问题所在。如果您检查gemfile.lock
,您会看到它已修复。
更改Gemfile中的版本不会影响加载哪个gem版本。实际上需要捆绑安装/捆绑更新。
如何解决这个问题的例子在Devise Gem documentation中。
将您的gemfile更改为gem 'devise'
并运行bundle install
rubygems本身将根据ruby版本找到依赖的gem版本并将其锁定到gemfile.lock。