Gemfile返回了很多依赖项

时间:2016-06-08 13:04:29

标签: ruby-on-rails deployment

我在Ruby on Rails中编写了一个项目并尝试部署它。这是Gemfile:

source 'http://rubygems.org'
source 'http://gems.github.com'

gem 'rails', '4.2.6'

gem 'rake','0.8.7'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

#gem 'mysql2', '0.2.6'
gem 'mysql2', '0.3.20'

# GUID generator
gem 'uuidtools', '2.1.2'

# Paperclip: for image resizing
gem 'paperclip', '2.4'

# Delayed job
gem 'delayed_job', '2.1.2'

# Typus, admin interface
gem 'typus', '3.0.2'

# set attribute value to nil if blank
gem "nilify_blanks", '1.0.0'

# ssl gem
gem "bartt-ssl_requirement", "~> 1.2.7", :require => 'ssl_requirement'

# for social login
gem 'omniauth', '0.2.0'

# to detect user location
gem 'geocoder', '1.1.0'

# use to sanitize html
gem 'sanitize', '2.0.1'

# captcha for registration
gem 'recaptcha', '0.3.1', :require => "recaptcha/rails"
# base 32
gem 'base32', '0.1.3'

# amazon s3
gem 'aws-s3', '0.6.2'

#json
gem 'json', '1.7.7'

# pagination
gem 'will_paginate', '3.0.pre2'

# jammit for asset packaging
gem 'jammit', '0.6.3'

gem 'oniguruma'

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger (ruby-debug for Ruby 1.8.7+, ruby-debug19 for Ruby 1.9.2+)
# gem 'ruby-debug'
# gem 'ruby-debug19'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri', "1.4.4.1"
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

gem "fb_graph", "1.9.5"

gem 'sitemap_generator', '2.1.8'

gem 'fastercsv', "1.5.5"

# to make it the same prior to 3.018 upgrade

gem 'addressable', "2.2.4"
gem 'arel', "6.0"
gem 'attr_required', '0.0.3'

gem 'cocaine', "0.2.0"
gem 'daemons', "1.1.0"

gem 'httpclient', '2.2.1'
gem 'i18n', '0.5.0'

gem 'mail', '2.5.4'

gem 'mime-types', '1.16'
gem 'multipart-post', '1.1.0'
gem 'nokogiri', '1.4.4'
gem 'oauth', '0.4.4'
gem 'open4', '1.2.0'
gem 'polyglot', '0.3.1'
gem 'pyu-ruby-sasl', '0.0.3.2'
gem 'rack', '1.6'
gem 'rack-mount', '0.6.13'
gem 'rack-oauth2', '0.9.2'
gem 'rack-test', '0.5.6'
gem 'rest-client', '1.6.1'
gem 'ruby-openid', '2.1.8'
gem 'treetop', '1.4.9'
gem 'tzinfo', '1.1'
gem 'xml-simple', '1.0.15'  

然后我运行bundle update来更新与rails 4.2.6不兼容的gem包。我收到了这个错误:

Bundler could not find compatible versions for gem "activesupport":
 In Gemfile:
   rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6)    rails (= 4.2.6) was resolved to 4.2.6, which depends on
     actionview (= 4.2.6) was resolved to 4.2.6, which depends on
       activesupport (= 4.2.6) x86-mingw32    delayed_job (= 2.1.2) was resolved to 2.1.2, which depends on
     activesupport (~> 3.0)    delayed_job (= 2.1.2) was resolved to 2.1.2, which depends on
     activesupport (~> 3.0) x86-mingw32    paperclip (= 2.4) was resolved to 2.4.0, which depends on
     activesupport (>= 2.3.2)    paperclip (= 2.4) was resolved to 2.4.0, which depends on
     activesupport (>= 2.3.2) x86-mingw32    rack-oauth2 (= 0.9.2) was resolved to 0.9.2, which depends on
     activesupport (>= 2.3)    rack-oauth2 (= 0.9.2) was resolved to 0.9.2, which depends on
     activesupport (>= 2.3) x86-mingw32  

所以我将gem 'activesupport', '4.2.6'添加到Gem文件并再次运行bundle update,但是出现了同样的错误。我该如何解决?

1 个答案:

答案 0 :(得分:1)

错误消息的第一行描述了这种情况:bundler无法找到满足Gemfile中其他gem的冲突要求的活动支持版本。由于问题在于捆绑程序无法找到合适版本的活动支持,因此手动指定版本不太可能有所帮助。

消息的其余部分只是所有相关依赖项的列表,以帮助您找到冲突。从那里你可以看到你的Gemfile引脚delayed_job到版本2.1.2,而后者又要求主动支持为〜> 3.0与使用rails 4.2.6的要求相冲突。

您需要删除或更新所需的延迟作业版本。从内存中,您需要4.0或更高版本的延迟作业。这些版本还将延迟作业的核心与持久性后端的选择分开,因此您也需要添加delayed_job_active_record gem。延迟作业的升级说明有更多详细信息。