I have rubygems 1.3.1 installed but I want to go back to 1.2.0. What's the command to downgrade rubygems?
-
Is there any particular reason why you need to downgrade (maybe because of the behavior of putting gems in ~/.gems when you forget sudo)? – Jarin Udom Feb 07 '09 at 21:51
-
This would be a reason why: http://stackoverflow.com/questions/4859600/bundler-throws-uninitialized-constant-gemsilentui-nameerror-error-after-upgra – Ramon Tayag Feb 01 '11 at 08:28
6 Answers
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

- 2,179
- 2
- 12
- 21
-
1Thanks! 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. – Brian Armstrong Feb 23 '11 at 08:32
-
1@BrianArmstrong There is also a bug in 2.3.x which is already fixed in the rails `2-3-stable` branch (see [link](https://github.com/rails/rails/commit/abc06a2f769e6e451462460610369ccddb45255d)). Perhaps this fix will be available in the next release of 2.2.x. – pseidemann Feb 25 '11 at 17:19
-
-
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? – aarona May 21 '13 at 06:26
-
@DJTripleThreat see http://stackoverflow.com/a/7700388/616310 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 ruby – pseidemann Jul 31 '13 at 09:31
-
Updated November 2011: Now that RVM's out, try running rvm install rubygems <version>
.

- 106,965
- 23
- 235
- 261
-
36Eh, much better to ```sudo gem update --system 1.4.2``` or ```rvm install rubygems 1.4.2``` – mrm Aug 29 '11 at 04:23
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

- 1,545
- 1
- 13
- 13
-
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 :) – Max Williams Jun 20 '11 at 14:58
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

- 2,465
- 14
- 8
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.

- 2,727
- 6
- 29
- 59
-
Had to add --force if I wanted to downgrade otherwise rvm wouldn't proceed with the install – Christian Jul 04 '18 at 22:06
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.

- 9,102
- 4
- 40
- 35