downgrading rails 4 to 3.2

前端 未结 6 661
醉梦人生
醉梦人生 2020-12-16 04:39

I have the Rails 4.0.0.beta1 installed but I need downgrade to Rails 3.2.13.

I\'ve used gem install rails 3.2 but Rails continues as 4.0.0.beta1.

<
相关标签:
6条回答
  • 2020-12-16 04:59

    Try the following in your console. It will update or install rails to the specified version.

    gem update rails 3.2.13
    
    0 讨论(0)
  • 2020-12-16 05:02

    The answers to gem uninstall rails --version xxx should remove the rails gem just fine.

    However, in the event you want or need to have multiple versions of rails available simultaneously, you can use bundler to load the correct versions of gems (as intended).

    $ bundle exec rails in the project directory that lists the version of rails in the Gemfile should let you load the required gems without conflict.

    Additionally, rvm and its gemset feature could also let you accomplish the same goal without needing to wrap everything with a bundle exec

    0 讨论(0)
  • 2020-12-16 05:11

    Unless you're using bundle exec, Rubygems will always use the latest installed version of a gem. You need to uninstall the version you don't want.

    gem uninstall rails --version 4.0.0.beta1
    
    0 讨论(0)
  • 2020-12-16 05:16

    I had the same problem with Rails 4.0.0 final version. To check what is currently installed you can run the following:

    >pik gem list
    

    Then I checked the rails versions. It showed rails 3.2.14 (what I wanted) with railties 4.0.0, 4.0.0.rc2 and 3.2.14.

    I then ran

    >gem uninstall railties
    

    and uninstalled all other versions except 3.2.14 and now it works well. The problem was that when Rails 3.2 installation is called, the latest (or all) versions of railties is installed.

    If you have other versions of rails other tan the one you want, you can removed them with

    >gem uninstall rails
    

    and remove the versions of rails you do not want to have.

    0 讨论(0)
  • 2020-12-16 05:18

    Rails will use the version specified in Gemfile:

    gem "rails", "4.0.0.beta1"
    

    Replace it with the version you'd like to use instead:

    gem "rails", "~> 3.2.0"
    

    Of course, you will also need to change your code and config to use the old Rails API.

    0 讨论(0)
  • 2020-12-16 05:19

    You have the same problem as listed here.

    Here is what worked for me, and should also for you. It's a more general solution that works regardless of your specific version of the Rails beta. Please note that in order to shift back to 3.2.13 (or whatever version you'd like to go back to), you must remove Railties as well as Rails.

    Just do:

    gem uninstall rails

    Then, select the version of Rails 4 you have and delete it.

    Then, do:

    gem uninstall railties

    And do the same thing.

    When I uninstalled the Rails 4 version of railties, it told me that dependencies for a couple gems (coffee-rails and sass-rails) wouldn't be met. So I just did the same thing with both of them as I did above, and deleted their Rails 4 versions as well (for example, for sass-rails, I had a version installed called sass-rails-4.0.0.rc1).

    And done! The terminal should list 3.2.13 as your current Rails version.

    0 讨论(0)
提交回复
热议问题