我正在尝试将现有的Rails 4.2应用程序升级到Rails 5.0。在Gemfile中将Rails gem更改为5.0.2,如下所示。
source "https://rubygems.org"
gem "rake", "~> 0.9.2"
#gem "rails", "~> 4.2.7.1"
gem 'rails', "~> 5.0.1"
gem "mysql2"
gem "mime-types", "~> 1.16", require: "mime/types"
gem "rubyzip", "~> 1.1.0"
gem "nokogiri", "1.6.8".
gem "apn_on_rails", "0.4.1", git:"https://bitbucket.orgsheridangroupapn_on_rails.git"
gem "gdata_19", "~>1.1.5"
gem "gcm_on_rails", "0.2.1", git: "https://bitbucket.org/sheridangroup/gcm_on_rails"
gem "open4", "1.0.1"
gem "rmagick", "2.13.2", require: "RMagick"
gem 'aws-sdk-v1' #aws-sdk v1 is used for url signing, as v2 has a one-week expiration limit
gem 'aws-sdk', '~> 2'
gem "libxml-ruby", "~> 2.7.0", require: "libxml"
gem "bitly", "0.10.0"
gem "uuid", "~> 2.3.7"
gem "htmlentities", "4.3.4"
gem "paper_trail", "~> 6.0.2"
gem "mechanize"
gem "rbtree", "0.4.2"
gem "resque"
gem "yajl-ruby" # For resque
gem "json", "~> 1.8.3"
gem "minitest"
gem "will_paginate"
gem "configatron", "~> 2.13.0"
gem "american_date", "~> 1.1.0"
gem "builder"
gem "coderay"
gem "json-schema"
gem "rspec"
gem "jquery-rails", "~> 4.2.2"
gem "jquery-ui-rails"
gem 'jquery-timepicker-addon-rails'
gem 'bcrypt', '~> 3.1.7'
gem "net-ftp-list"
gem 'recursive-open-struct'
gem 'slim'
gem 'paranoia'
gem 'typhoeus'
gem 'bundler', '1.12.5'
gem "paperclip", "~> 4.3.7"
group :test do
#gem 'spork-rails'
gem 'capybara'
gem 'poltergeist'
gem 'simplecov', require: false
gem 'simplecov-rcov', require: false
gem 'timecop'
gem 'test-unit'
end
# Used for NewRelic monitoring in Staging env only
group :staging, :production do
gem "newrelic_rpm"
gem "ey_config"
end
group :test, :development do
gem "rspec-rails", require: false
gem "listen", ">= 0.5.1", require: false
gem "machinist", "~> 2.0", require: false
gem "database_cleaner", "~> 0.9.1", require: false
gem 'pry-byebug'
end
group :development do
# <browser-debugging-tools>
gem "better_errors"
gem "binding_of_caller"
gem "meta_request"
# </browser-debugging-tools>
gem 'quiet_assets' # prevent assets pipeline logging
gem 'rubocop', '0.35.0'
end
group :assets do
gem "sass-rails"
gem "coffee-rails"
gem "uglifier", "2.7.2"
end
尝试运行bundle update
,但在控制台中出现以下错误。
Bundler could not find compatible versions for gem "rack":
In Gemfile:
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
actioncable (= 5.0.1) was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) was resolved to 5.0.1, which depends on
rack (~> 2.0)
better_errors was resolved to 2.1.1, which depends on
rack (>= 0.9.0)
capybara was resolved to 2.12.1, which depends on
rack (>= 1.0.0)
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
actioncable (= 5.0.1) was resolved to 5.0.1, which depends on
actionpack (= 5.0.1) was resolved to 5.0.1, which depends on
rack-test (~> 0.6.3) was resolved to 0.6.3, which depends on
rack (>= 1.0)
resque was resolved to 1.27.2, which depends on
sinatra (>= 0.9.2) was resolved to 1.1.0, which depends on
rack (~> 1.1)
sass-rails was resolved to 5.0.6, which depends on
sprockets (< 4.0, >= 2.8) was resolved to 3.7.1, which depends on
rack (< 3, > 1)
Bundler could not find compatible versions for gem "rails":
In Gemfile:
rails (~> 5.0.1)
quiet_assets was resolved to 1.0.0, which depends on
rails (~> 3.1)
Bundler could not find compatible versions for gem "railties":
In Gemfile:
coffee-rails was resolved to 4.2.1, which depends on
railties (< 5.2.x, >= 4.0.0)
jquery-rails (~> 4.2.2) was resolved to 4.2.2, which depends on
railties (>= 4.2.0)
jquery-timepicker-addon-rails was resolved to 1.4.1, which depends on
railties (>= 3.1)
quiet_assets was resolved to 1.0.1, which depends on
railties (~> 3.1)
rails (~> 5.0.1) was resolved to 5.0.1, which depends on
railties (= 5.0.1)
我想继续升级到Rails 5.0。我可以找到解决所有错误的方向。
rspec-rails was resolved to 3.5.2, which depends on
railties (>= 3.0)
sass-rails was resolved to 5.0.6, which depends on
railties (< 6, >= 4.0.0)
答案 0 :(得分:0)
删除您的Gemfile.lock文件,然后尝试再次更新。