我搜索了SO,有几个相关问题,但都不能解决我的问题。
当我运行时:$ bundle update
Fetching gem metadata from https://gems.ruby-china.org/..........
Fetching version metadata from https://gems.ruby-china.org/..
Resolving dependencies...
Bundler could not find compatible versions for gem "railties":
In Gemfile:
devise (~> 3.5.0) was resolved to 3.5.1, which depends on
railties (< 5, >= 3.2.6)
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
railties (= 5.0.1)
图片如下:
然后,我运行 $ rails -v
:
Could not find gem 'devise (~> 3.5.0)' in any of the gem sources listed in your Gemfile or available on this machine.
最佳答案
您已将您的设计版本修复为“3.5.x”版本,这与 rails 5 不兼容。在您的 Gemfile 中,您需要更改您使用的设计版本,可能是 4.x 版本,作为 3.5,像这样:
gem '设计', '~> 3.5.0'
应该变成
gem '设计', '~> 4.1.0'
或类似的东西。
关于ruby-on-rails - 捆绑更新时,Bundler 找不到 gem "railties"的兼容版本,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41876998/