我正在尝试将Rails 4.2应用程序升级到5.2.3。
我的系统是MacOS 10.14.6 Mojave。 Bundler版本2.0.2
这是我执行bundle update
之后的错误:
Bundler could not find compatible versions for gem "actionpack":
In Gemfile:
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
actionpack (= 5.2.4.rc1)
simple_form was resolved to 5.0.1, which depends on
actionpack (>= 5.0)
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
sprockets-rails (>= 2.0.0) was resolved to 3.2.1, which depends on
actionpack (>= 4.0)
Bundler could not find compatible versions for gem "activemodel":
In Gemfile:
paperclip was resolved to 6.1.0, which depends on
activemodel (>= 4.2.0)
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
activemodel (= 5.2.4.rc1)
simple_form was resolved to 5.0.1, which depends on
activemodel (>= 5.0)
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
acts-as-taggable-on was resolved to 6.5.0, which depends on
activerecord (< 6.1, >= 5.0)
deep_cloneable was resolved to 3.0.0, which depends on
activerecord (< 7, >= 3.1.0)
oink was resolved to 0.10.1, which depends on
activerecord
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
activerecord (= 5.2.4.rc1)
Bundler could not find compatible versions for gem "activesupport":
In Gemfile:
jbuilder (~> 2.0) was resolved to 2.9.1, which depends on
activesupport (>= 4.2.0)
activeadmin was resolved to 2.5.0, which depends on
kaminari (>= 1.0.1, ~> 1.0) was resolved to 1.1.1, which depends on
activesupport (>= 4.1.0)
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
activesupport (= 5.2.4.rc1)
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
sprockets-rails (>= 2.0.0) was resolved to 3.2.1, which depends on
activesupport (>= 4.0)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
activeadmin was resolved to 2.5.0, which depends on
railties (< 6.1, >= 5.2)
coffee-rails (~> 4.1.0) was resolved to 4.1.0, which depends on
railties (< 5.0, >= 4.0.0)
devise was resolved to 4.2.1, which depends on
railties (< 5.1, >= 4.1.0)
activeadmin was resolved to 2.5.0, which depends on
jquery-rails (~> 4.2) was resolved to 4.3.5, which depends on
railties (>= 4.2.0)
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
railties (= 5.2.4.rc1)
这是我仅更新滑轨bundle update rails
时得到的:
Bundler could not find compatible versions for gem "activerecord":
In Gemfile:
acts-as-taggable-on was resolved to 5.0.0, which depends on
activerecord (>= 4.2.8)
deep_cloneable was resolved to 3.0.0, which depends on
activerecord (< 7, >= 3.1.0)
oink was resolved to 0.10.1, which depends on
activerecord
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
activerecord (= 5.2.4.rc1)
activeadmin was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
activerecord (< 5.2, >= 3.0)
这是我的宝石文件:
source 'https://rubygems.org'
ruby '2.5.1'
gem 'rails', '~> 5.2.3'
gem 'mysql2', '<= 0.5.1'
gem 'mini_racer'
gem 'sass-rails'
gem 'coffee-rails', '~> 4.1.0'
gem 'uglifier', '>= 1.3.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem 'jbuilder_cache_multi'
# gem 'sidekiq'
# gem 'sinatra', require: false # Required by sidekiq/web
gem 'savon'
gem 'soap4r'
gem 'kaminari'
# gem 'actionpack-action_caching'
gem 'acts-as-taggable-on'
gem 'rest-client'
gem 'simple_form'
# gem 'responders', '~> 2.0'
gem 'paperclip'
gem 'whenever', require: false
gem 'typhoeus'
gem 'zip-zip', require: false
gem 'http'
gem 'activeadmin'
gem 'devise'
gem 'redis-rails'
gem 'crack'
gem 'trollop'
gem 'oink'
# gem 'backport_new_renderer'
gem 'deep_cloneable'
gem 'gsl'
gem 'kmeans-clusterer'
gem 'scalpel'
gem 'pragmatic_segmenter'
gem 'memory_profiler'
gem 'parallel'
gem 'sqlite3', '~> 1.3', '>= 1.3.11'
gem 'sprockets-rails', :require => 'sprockets/railtie'
gem 'digest', git: 'git@github.com:ruby/digest.git'
gem 'httparty'
gem 'mail'
gem 'net-ssh'
gem 'highline'
group :production do
gem 'newrelic_rpm'
gem 'appsignal'
gem 'execjs'
gem 'puma'
gem 'puma_worker_killer'
end
group :development, :test do
gem 'byebug'
gem 'web-console', '~> 2.0'
# gem 'minitest-rails'
gem 'thin'
end
group :development do
gem 'awesome_print'
gem "capistrano"
gem 'capistrano-rails', require: false
gem 'capistrano-bundler', require: false
gem 'capistrano-sidekiq', require: false
gem 'quiet_assets'
gem 'better_errors'
gem 'binding_of_caller'
gem 'terminal-notifier-guard', require: false
gem 'terminal-notifier', require: false
gem 'derailed_benchmarks'
gem 'stackprof' # used by derailed_benchmarks
end
好像actionpack,activerecord,activemodel和activesupport都需要版本5.2.4.rc1
。这是我的本地宝石:
Xuans-MacBook-Pro:moldb xuan$ gem list "activesupport"
*** LOCAL GEMS ***
activesupport (6.0.1, 5.2.4.rc1, 5.2.3, 5.2.0, 5.1.6.1, 4.2.11.1, 4.2.10)
redis-activesupport (5.2.0, 5.0.7, 5.0.3, 4.0.0)
Xuans-MacBook-Pro:moldb xuan$ gem list "activemodel"
*** LOCAL GEMS ***
activemodel (6.0.1, 5.2.4.rc1, 5.2.3, 5.2.0, 5.1.6.1, 4.2.11.1, 4.2.10)
Xuans-MacBook-Pro:moldb xuan$ gem list "actionpack"
*** LOCAL GEMS ***
actionpack (6.0.1, 5.2.4.rc1, 5.2.3, 5.2.0, 5.1.6.1, 4.2.11.1, 4.2.10)
Xuans-MacBook-Pro:moldb xuan$ gem list 'railties'
*** LOCAL GEMS ***
railties (6.0.1, 5.2.4.rc1, 5.2.3, 5.2.0, 5.1.6.1, 4.2.11.1, 4.2.10)
我尝试了各种方法来解决此升级问题;但没有运气。删除Gemfile.lock
然后执行bundle install
对我来说不起作用(这会给出相同的错误输出)。
升级任何Rails应用程序时,它是如此令人沮丧,依赖地狱很难解决。
感谢您的帮助和建议!
答案 0 :(得分:1)
您必须修复gems版本,例如:
Bundler could not find compatible versions for gem "railties":
activeadmin was resolved to 2.5.0, which depends on
railties (< 6.1, >= 5.2)
coffee-rails (~> 4.1.0) was resolved to 4.1.0, which depends on
railties (< 5.0, >= 4.0.0)
devise was resolved to 4.2.1, which depends on
railties (< 5.1, >= 4.1.0)
activeadmin was resolved to 2.5.0, which depends on
jquery-rails (~> 4.2) was resolved to 4.3.5, which depends on
railties (>= 4.2.0)
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
railties (= 5.2.4.rc1)
这将告诉您,咖啡轨取决于<5.0的铁路轨,而铁路轨<5.1的铁路轨是设计的,而铁路5.23的铁路轨线则取决于5.2.4.rc1。因此,在这种情况下,您应该要求使用较新版本的devise和coffee-rails。
Bundler could not find compatible versions for gem "activerecord":
acts-as-taggable-on was resolved to 5.0.0, which depends on
activerecord (>= 4.2.8)
deep_cloneable was resolved to 3.0.0, which depends on
activerecord (< 7, >= 3.1.0)
oink was resolved to 0.10.1, which depends on
activerecord
rails (~> 5.2.3) was resolved to 5.2.4.rc1, which depends on
activerecord (= 5.2.4.rc1)
activeadmin was resolved to 1.4.3, which depends on
ransack (>= 1.8.7) was resolved to 1.8.10, which depends on
activerecord (< 5.2, >= 3.0)
这个告诉您,您需要的是activeadmin 1.4.3,它取决于ransak> = 1.8.7,它取决于activerecord <5.2,但rails 5.2.3取决于activerecord 5.2.4.rc1。您需要更新您的activeadmin和ransack gem。
修复每个宝石的冲突,告知您的gemfile使用哪个版本,您可以在rubygems上进行检查。
您已在系统上安装了gem,但是其他gem的依赖项之间存在冲突。