Bundler找不到gem“activerecord”的兼容版本:

时间:2015-11-16 13:59:04

标签: ruby-on-rails ruby ruby-on-rails-3 activerecord gem

当我尝试升级

  • Ruby 1.9.3 to Ruby 2.2.2
  • Rails 3.2.14 to Rails 4.2.4

运行bundle install时出现此错误:

Bundler could not find compatible versions for gem "activerecord":
  In Gemfile:
    makara (~> 0.3.0.rc3) ruby depends on
      activerecord (>= 3.0.0) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby

    audited-activerecord (>= 0) ruby depends on
      activerecord (~> 4.0) ruby

    acts_as_paranoid (>= 0) ruby depends on
      activerecord (~> 3.2) ruby

Bundler could not find compatible versions for gem "polyamorous":
  In Gemfile:
    activeadmin (>= 0) ruby depends on
      ransack (~> 1.3) ruby depends on
        polyamorous (~> 1.2) ruby

    squeel (>= 0) ruby depends on
      polyamorous (~> 0.6.0) ruby

Bundler could not find compatible versions for gem "activesupport":
  In Gemfile:
    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    factory_girl_rails (>= 0) ruby depends on
      factory_girl (~> 4.5.0) ruby depends on
        activesupport (>= 3.0.0) ruby

    activeadmin (>= 0) ruby depends on
      inherited_resources (~> 1.6) ruby depends on
        has_scope (~> 0.6.0.rc) ruby depends on
          activesupport (< 5, >= 3.2) ruby

    factory_girl_rails (>= 0) ruby depends on
      factory_girl (~> 4.5.0) ruby depends on
        activesupport (>= 3.0.0) ruby

    rails (~> 4.2.3) ruby depends on
      activerecord (= 4.2.3) ruby depends on
        activesupport (= 4.2.3) ruby

    rails (~> 4.2.3) ruby depends on
      actionmailer (= 4.2.3) ruby depends on
        rails-dom-testing (>= 1.0.5, ~> 1.0) ruby depends on
          activesupport (< 5.0, >= 4.2.0.beta) ruby

    jbuilder (~> 2.0) ruby depends on
      activesupport (< 5, >= 3.0.0) ruby

    rspec-rails (>= 0) ruby depends on
      activesupport (< 4.3, >= 3.0) ruby

    rails (~> 4.2.3) ruby depends on
      actionmailer (= 4.2.3) ruby depends on
        activejob (= 4.2.3) ruby depends on
          globalid (>= 0.3.0) ruby depends on
            activesupport (>= 4.1.0) ruby

    exception_notification (>= 0) ruby depends on
      activesupport (>= 3.0.4) ruby

    activeadmin (>= 0) ruby depends on
      ransack (~> 1.3) ruby depends on
        activesupport (>= 3.0) ruby

    shoulda-matchers (>= 0) ruby depends on
      activesupport (>= 4.0.0) ruby

    rails (~> 4.2.3) ruby depends on
      actionmailer (= 4.2.3) ruby depends on
        rails-dom-testing (>= 1.0.5, ~> 1.0) ruby depends on
          rails-deprecated_sanitizer (>= 1.0.1) ruby depends on
            activesupport (>= 4.2.0.alpha) ruby

    factory_girl_rails (>= 0) ruby depends on
      factory_girl (~> 4.5.0) ruby depends on
        activesupport (>= 3.0.0) ruby

    delayed_job_active_record (>= 0) ruby depends on
      delayed_job (< 5, >= 3.0) ruby depends on
        activesupport (< 5.0, >= 3.0) ruby

    fbgraph (>= 0) ruby depends on
      activesupport (>= 0) ruby

    fbgraph (>= 0) ruby depends on
      activesupport (>= 0) ruby

    fbgraph (>= 0) ruby depends on
      activesupport (>= 0) ruby

    fbgraph (>= 0) ruby depends on
      activesupport (>= 0) ruby

    activeadmin (>= 0) ruby depends on
      ransack (~> 1.3) ruby depends on
        activesupport (>= 3.0) ruby

    enumerize (>= 0) ruby depends on
      activesupport (>= 3.2) ruby

    fbgraph (>= 0) ruby depends on
      activesupport (>= 0) ruby

    squeel (>= 0) ruby depends on
      activesupport (~> 3.1.0.alpha) ruby

我的gemfile看起来像这样

source 'https://rubygems.org'
gem 'rails', "~>4.2.4"
gem 'bundler'
gem "rake"
gem 'maxminddb'
gem 'thin'
gem 'mysql2'
gem 'settingslogic'
gem 'ipaddress'
gem 'geocoder'
gem 'enumerize'
gem 'httparty'
gem 'attr_encrypted'
gem 'time_difference'
gem 'ruby-ip'
gem 'rack-cors' # required for cors support
gem 'rack-google-analytics'
gem "rails_best_practices"
gem 'simplecov', :require => false, :group => :test
gem 'whenever', :require => false
gem 'acts_as_list'
gem "audited-activerecord"
gem 'delayed_job_active_record'
gem "acts_as_paranoid"
gem "squeel" # meta where
gem 'attribute_normalizer'
gem 'exception_notification'
gem 'aws-sdk'
gem 'recurly'
gem "fbgraph"
gem "hex_string"
gem 'will_paginate'
gem "gabba"
gem "chronic_duration"
gem "chronic"
gem 'countries'
gem "useragent"
gem "factory_girl_rails"
gem "faker"
gem "rails_admin"
gem 'composite_primary_keys'
gem 'mandrill-api'
group :assets do
  gem 'uglifier', '>= 1.3.0'
end
gem 'sass-rails', '~> 5.0'
gem 'coffee-rails', '~> 4.1.0'
gem 'jquery-rails'
gem 'jbuilder', '~> 2.0'
gem 'activeadmin', github: 'activeadmin'
gem 'geokit'
gem 'default_value_for'
gem 'csv-mapper'
gem 'actionmailer'
gem 'mail'
gem 'ruby_regex'
gem "devise"
gem 'meta_search', '>= 1.1.0.pre'
gem "ransack"
gem 'newrelic_rpm'
gem 'newrelic-grape'
gem 'makara', '~> 0.3.0.rc3'
gem 'rack'
gem 'warden'
gem 'omniauth'
gem 'omniauth-twitter'
gem 'omniauth-facebook'
gem 'cancan'
gem 'execjs'
gem 'therubyracer', :platforms => :ruby
gem 'userstamp', :git => 'git://github.com/kimkong/userstamp.git'
gem "rails-settings-cached"

请帮忙。

1 个答案:

答案 0 :(得分:0)

我有几乎相同的错误,但我也有信息,因为我需要更新bundler和rake,所以常规的更新方式是重现相同的错误。

我的解决方案是添加&#39; --source http://rubygems.org&#39;在安装线上: 喜欢: gem install rake -v&#39; 11.3.0&#39; --source http://rubygems.org gem install bundler --pre --source http://rubygems.org