Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to downgrade my rails version?

I am using rails version 4.2.0. How can I downgrade to version 3.2.19?

I tried the following:

  1. I opened command prompt.
  2. I typed gem uninstall rails
  3. Some options came for rails version then I selected my current version and pressed entered.
  4. Then typed gem install rails -v 3.2.19 for installing this version.
  5. I went to my Site directory and typed rails new blog
  6. When I opened the Gemfile of blog application I found again Rails version 4.2.0 is present there.
like image 941
bapi123 Avatar asked Jan 22 '15 05:01

bapi123


3 Answers

Do:

gem uninstall rails
gem uninstall railties

Followed by:

gem install rails -v 3.2.19 

To check a rails version, directly do:

rails -v

Another workaround:

add following to your Gemfile:

 gem 'rails', '3.2.19'

and then run:

bundle install
like image 103
shivam Avatar answered Oct 20 '22 19:10

shivam


Or you dont have to downgrade. You can always create a new rails app with a specific version(if that version is already installed)

rails _3.2.19_ new myApp
like image 25
Santhosh Avatar answered Oct 20 '22 18:10

Santhosh


That is not good approach to uninstall a global version of Rails. So just create a Rails app:

rails new app

then change Rails version in its Gemfile, and issue bundle install:

cd app
sed "s/'rails', '~> 4.2.0'/'rails', '~> 3.2.19'/" -i Gemfile
bundle install

Then, I believe, you should change all the dependent packages to older versions.

like image 40
Малъ Скрылевъ Avatar answered Oct 20 '22 20:10

Малъ Скрылевъ