How do you downgrade rubygems?
Asked Answered
W

6

101

I have rubygems 1.3.1 installed but I want to go back to 1.2.0. What's the command to downgrade rubygems?

Wonderment answered 7/2, 2009 at 15:47 Comment(2)
Is there any particular reason why you need to downgrade (maybe because of the behavior of putting gems in ~/.gems when you forget sudo)?Windowlight
This would be a reason why: #4860100Utu
T
39

Updated November 2011: Now that RVM's out, try running rvm install rubygems <version>.

Tamekia answered 7/2, 2009 at 21:33 Comment(1)
Eh, much better to sudo gem update --system 1.4.2 or rvm install rubygems 1.4.2Longitude
B
203

This worked for me when downgrading from 1.5.2 to 1.4.2 because of old rails version:

sudo gem update --system 1.4.2

More information about downgrading/upgrading rubygems: https://github.com/rubygems/rubygems/blob/master/UPGRADING.md

Borodino answered 14/2, 2011 at 13:55 Comment(6)
Thanks! This worked for me. Have an old Rails 2.2.2 project that complained without this. I still don't know why actually (if anyone has details on that I'd be curious) but at least it works now.Downcome
@BrianArmstrong There is also a bug in 2.3.x which is already fixed in the rails 2-3-stable branch (see link). Perhaps this fix will be available in the next release of 2.2.x.Borodino
This seems like the most reliable way.Pre
does this do it just for a particular gemset though? or would i need to go back and forth between rubygems if I want to switch between rails 2 and rails 3 development?Inoperative
@DJTripleThreat see https://mcmap.net/q/212312/-use-multiple-versions-of-rubygems-with-rvm for rvm. when you use rbenv it should be enough to copy the ruby installation. when you don't use rbenv nor rvm than I would suggest you to use rbenv because otherwise you need to go back and forth with the system rubyBorodino
getting segment fault :(Sanctum
T
39

Updated November 2011: Now that RVM's out, try running rvm install rubygems <version>.

Tamekia answered 7/2, 2009 at 21:33 Comment(1)
Eh, much better to sudo gem update --system 1.4.2 or rvm install rubygems 1.4.2Longitude
L
25

If you're using RVM, then you can do this to remove current ruby gems, then upgrade/downgrade rubygems:

rvm install rubygems 1.4.2
Lancaster answered 9/3, 2011 at 5:14 Comment(1)
just googled this to try and get rid of a ton of deprecation warnings caused by recent rubygems updates, saved me a lot of hassle, thanks :)Scirrhus
H
15

This just worked for me on OSX to get from 1.5.0 back to 1.4.2

sudo gem uninstall -v '1.5.0' rubygems-update
sudo gem update --system --local
Herbartian answered 1/2, 2011 at 3:33 Comment(0)
D
2

I had a similar problem in an old Rails 3 stack. When these type of issues occur, my recommendation is to go onto the production server that the application is currently running in and check out which rubygems version it is using:

gem -v

For me, it was using 1.8.24. So all I needed to do is downgrade my current rubygems which was generated from "rvm install 1.9.3", when I installed the old ruby for this app. I ran the following command:

 $ rvm install rubygems 1.8.24 --force

And it worked. Note I am running Ubuntu 14.04 and the server I am using is also Ubuntu.

Death answered 14/4, 2015 at 3:44 Comment(1)
Had to add --force if I wanted to downgrade otherwise rvm wouldn't proceed with the installAniakudo
O
-1

I used this command to go back to the gem version that my ruby version needed:

rvm rubygems current

If it gives checksum errors try

rvm rubygems current --verify-downloads 1

That did the trick for me.

Oto answered 16/9, 2013 at 16:28 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.