升级到 Rails 5,无法解决依赖关系
Upgrading to Rails 5, can't resolve dependencies
从 Rails 4.2.10 升级到 Rails 5.1.4 会导致以下错误消息。我不确定如何解决依赖关系。 ruby 版本为 2.5.1。 Rails 4.2.10 运行没有问题,bundle upgrade
运行没有返回任何错误。
更新: 在下面添加了 Gemfile 以供参考。在执行 bundle update
之前删除 Gemfile.lock
时,仍然会生成以下错误消息。
错误信息
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
gem 网络控制台正在锁定您的更新过程,首先将其更改为更新的版本,例如:
gem 'web-console', '>= 3.3.0'
然后删除 Gemfile.lock
和 运行 bundle install
也总是好的检查其他 gem 的版本并检查官方 Rails 升级http://guides.rubyonrails.org/upgrading_ruby_on_rails.html
中的流程文档
从 Rails 4.2.10 升级到 Rails 5.1.4 会导致以下错误消息。我不确定如何解决依赖关系。 ruby 版本为 2.5.1。 Rails 4.2.10 运行没有问题,bundle upgrade
运行没有返回任何错误。
更新: 在下面添加了 Gemfile 以供参考。在执行 bundle update
之前删除 Gemfile.lock
时,仍然会生成以下错误消息。
错误信息
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
gem 网络控制台正在锁定您的更新过程,首先将其更改为更新的版本,例如:
gem 'web-console', '>= 3.3.0'
然后删除 Gemfile.lock
和 运行 bundle install
也总是好的检查其他 gem 的版本并检查官方 Rails 升级http://guides.rubyonrails.org/upgrading_ruby_on_rails.html