从Rails 4.2.10升级到Rails 5.1.4将导致下面的错误消息。我不知道如何解决依赖关系。红宝石版本为2.5.1。Rails 4.2.10在没有问题的情况下运行,bundle upgrade运行时不返回任何错误。
更新:添加了下面的Gemfile以供参考。在执行Gemfile.lock之前删除bundle update时,仍然会生成以下错误消息。
错误消息
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
rails (~> 5.1.4) was resolved to 5.1.4, which depends on
activemodel (= 5.1.4)
web-console (~> 2.0.0.beta3) was resolved to 2.0.0, which depends on
activemodel (~> 4.0)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
jbuilder (~> 2.7.0) was resolved to 2.7.0, which depends on
activesupport (>= 4.2.0)
rails (~> 5.1.4) was resolved to 5.1.4, which depends on
activesupport (= 5.1.4)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.1.4)
Could not find gem 'rails (~> 5.1.4)' in any of the sources.Bundler could not
find compatible versions for gem "activemodel":
In Gemfile:
rails (~> 5.1.4) was resolved to 5.1.4, which depends on
activemodel (= 5.1.4)
web-console (~> 2.0.0.beta3) was resolved to 2.0.0, which depends on
activemodel (~> 4.0)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
jbuilder (~> 2.7.0) was resolved to 2.7.0, which depends on
activesupport (>= 4.2.0)
rails (~> 5.1.4) was resolved to 5.1.4, which depends on
activesupport (= 5.1.4)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.1.4)
Could not find gem 'rails (~> 5.1.4)' in any of the sources.Gemfile
source 'https://rubygems.org'
gem 'rails', '~> 5.1.4'
gem 'sass-rails'
gem 'bootstrap-sass'
gem 'bcrypt'
gem 'uglifier', '~> 3.2.0'
gem 'coffee-rails', '~> 4.2.2'
gem 'jquery-rails', '~> 4.3.1'
gem 'turbolinks', '~> 5.0.1'
gem 'jbuilder', '~> 2.7.0'
gem 'sdoc', '~> 0.4.0', group: :doc
gem 'stripe'
group :development, :test do
gem 'sqlite3', '~> 1.3.9'
gem 'byebug', '~> 3.4.0'
gem 'web-console', '~> 2.0.0.beta3'
gem 'spring', '~> 1.1.3'
end
group :test do
gem 'minitest-reporters', '~> 1.0.5'
gem 'mini_backtrace', '~> 0.1.3'
gem 'guard-minitest', '~> 2.3.1'
end
group :production do
gem 'pg', '0.17.1'
gem 'rails_12factor', '0.0.2'
gem 'puma'
end发布于 2018-06-17 05:27:52
gem web控制台正在锁定您的更新过程,首先将其更改为最近的版本,如下所示:
gem 'web-console', '>= 3.3.0'然后删除Gemfile.lock并运行bundle install,这对于检查其他gems的版本和检查rails.html中的官方Rails升级过程文档也总是有好处的。
https://stackoverflow.com/questions/50889198
复制相似问题