Douglas Sellers
Douglas Sellers

Reputation: 662

How do you update rubygems using rvm and ree?

How do you update rubygems under rvm when ree is your default vm (on Snow Leopard)? I am doing:

$ rvm ree gem update --system

This results in things looking like everything went fine:

Updating RubyGems
Updating rubygems-update
Successfully installed rubygems-update-1.3.7
Updating RubyGems to 1.3.7
Installing RubyGems 1.3.7
RubyGems 1.3.7 installed

[...]

RubyGems installed the following executables:
        /Users/douglassellers/.rvm/rubies/ree-1.8.7-2010.02/bin/gem

but when I run gem --version it still says 1.3.5. Doing a which gem points at ree version of gem.

Anyone know how to get rubygems to update with RVM?

Upvotes: 16

Views: 26966

Answers (4)

Nickolay Kondratenko
Nickolay Kondratenko

Reputation: 1951

rvm suggested me to use something like this:

rvm ruby-1.9.3-p327@mygemset do gem update --system

Upvotes: 2

shingara
shingara

Reputation: 46914

Now you can just do :

rvm rubygems latest

Or you can define which rubygems you really want. https://rvm.io/rubies/rubygems/

Upvotes: 36

Telemachus
Telemachus

Reputation: 19705

The problem, I think, is the initial command (or what you expect that command to do):

$ rvm ree gem update --system

That tells rvm to pass the gem update --system to the gem under ree, but it doesn't switch you to that particular Ruby interpreter. You continue using whatever interpreter you have set in that shell (whether by default or because you switched manually earlier in the shell session).

As an example, my default interpreter is Ruby 1.9.2. If I pass this command: rvm 1.9.1 gem install pony, then the Pony gem is installed for Ruby 1.9.1. However, I'm still using Ruby 1.9.2 after that installation is finished. If I enter irb and try require 'pony', I get a load error. If I run rvm 1.9.1 and then enter irb, Pony is installed and loads fine.

So as Brian says in his comment to your post, you could switch manually with rvm use ree. Alternatively, you could switch your initial command to this:

$ rvm ree
$ gem update --system
$ gem --version

Upvotes: 18

quantboy
quantboy

Reputation: 11

It is an unusual problem. If it is not yet resolved, consider using

rvm --default use ree
which ruby
which gem

this should show you if you are in the right version.
install gems either using rvm or directly.

Upvotes: 1

Related Questions