从Rails 3.2.22升级到Rails 4.2.4时出错

时间:2015-09-08 18:31:28

标签: ruby-on-rails ruby ruby-on-rails-4 bundler gemfile

我正在尝试使用Ruby 2.2.3将我们的应用程序从Rails 3.2.22升级到Rails 4.2.4。

这是我到目前为止所做的:

  1. 修改了Gemfile以指定rails, "~> 4.2.4"
  2. bundle
  3. bundle update rails
  4. 完整的成绩单如下。

    我们的Gemfile中没有指定ActiveRecord,所以我不明白它锁定了什么或在哪里修复它?

    Craigs-MacBook-Pro~/Work/mbc(master|✔) % git checkout -b rails-424
    Switched to a new branch 'rails-424'
    Craigs-MacBook-Pro~/Work/mbc(rails-424|✔) % vim Gemfile
    Craigs-MacBook-Pro~/Work/mbc(rails-424|✚1) % bundle
    Fetching gem metadata from https://rubygems.org/........
    Fetching version metadata from https://rubygems.org/...
    Fetching dependency metadata from https://rubygems.org/..
    You have requested:
      rails ~> 4.2.4
    
    The bundle currently has rails locked at 3.2.22.
    Try running `bundle update rails`
    Craigs-MacBook-Pro~/Work/mbc(rails-424|✚1) % bundle update rails
    Fetching gem metadata from https://rubygems.org/........
    Fetching version metadata from https://rubygems.org/...
    Fetching dependency metadata from https://rubygems.org/..
    Resolving dependencies............
    Bundler could not find compatible versions for gem "activerecord":
      In Gemfile:
        activerecord (< 4.3, >= 3.1) ruby
    
        activerecord (< 5.0, >= 3.0) ruby
    
        vestal_versions (>= 0) ruby depends on
          activerecord (~> 3.0) ruby
    
        activerecord (> 3.0.0) ruby
    
        rails (~> 4.2.4) ruby depends on
          activerecord (= 4.2.4) ruby
    Craigs-MacBook-Pro~/Work/mbc(rails-424|✚1) % 
    

1 个答案:

答案 0 :(得分:1)

vestal_versions gem与ActiveRecord 3.0有依赖关系。

您需要在Gemfile中取消指定vestal_versions gem的版本,或指定2.0.0然后:

bundle update rails vestal_versions