ruby-on-rails - 捆绑更新时,Bundler 找不到 gem "railties"的兼容版本

标签 ruby-on-rails ruby devise bundle-install

我搜索了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)

图片如下:

enter image description here

然后,我运行 $ 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/

相关文章:

html - 如何使用 Nokogiri 使用 CSS 选择器逐行解析?

ruby - Ruby 中的无方法错误

ruby-on-rails - 使用 Devise 实现双因素身份验证

ruby-on-rails - 具有权限连接表的声明式授权

ruby-on-rails - Rails 正则表达式电子邮件验证,不允许使用空格

ruby - 在测试自动化项目中使用 Ruby 是否不安全?

ruby-on-rails - 设计remember_me值

ruby-on-rails - 如何通过 devise_invitable 邀请现有用户

ruby-on-rails - 尝试为 ror 应用程序设置 postgres,出现错误 - fe_sendauth : no password supplied

javascript - Ember.js 错误 : No model was found for 'id' while saving record using ember-data