9

I am trying to set up Rails 3.0.3 running on my machine with Ruby 1.9.2. I have installed rvm and used it to install Ruby 1.9.2. What do do next to install the gems I want?

In particular, please give the command to install RubyGems 1.3.6 because Rails 3.0.3 is asking for it specifically. Can rvm install Rails by itself, or will I need RubyGems for that?

Kevin
  • 14,655
  • 24
  • 74
  • 124
Chani
  • 5,055
  • 15
  • 57
  • 92
  • rubygems is a ruby-level tool for managing and packaging different libraries of ruby code. rvm is a shell-level tool for managing different versions of the ruby interpreter. – Tim Snowhite May 02 '11 at 21:16

2 Answers2

10

Yes, you can install gems with rvm. Use:

rvm use 1.9.2 # Make sure you're using the installed version
rvm gem install --version '3.0.3' rails

Updated to include specific version of the gem.

Phrogz
  • 296,393
  • 112
  • 651
  • 745
  • but dont i need to install gems first ? i need gems 1.3.6. how can i get that ? – Chani Jan 11 '11 at 20:25
  • also please mention how to install a specified version of rails – Chani Jan 11 '11 at 20:26
  • Ruby includes rubygems as part of 1.9; you got it when you typed `rvm install 1.9.2`. I've also included in the answer how to install a specific gem version. – Phrogz Jan 11 '11 at 20:28
  • `ERROR: Loading command: install (LoadError) no such file to load -- zlib ERROR: While executing gem ... (NameError) uninitialized constant Gem::Commands::InstallCommand ` – Chani Jan 11 '11 at 20:34
  • See [this Stack Overflow answer](http://stackoverflow.com/questions/2441248/rvm-ruby-1-9-1-troubles/2808375#2808375) to fix your zlib issues. – Phrogz Jan 11 '11 at 20:38
  • 1
    leaving out the version gets the latest stable release – Blankman May 02 '11 at 22:01
5

Looks like you already have rails installed, from the way you've phrased the question. To install rubygems-1.3.6 using rvm just make sure your rvm install is updated and you're using the ruby you want, and then use rvm rubygems 1.3.6 to select that version of rubygems.

rvm get head
rvm reload
rvm use 1.9.2
rvm rubygems 1.3.6
Tim Snowhite
  • 3,736
  • 2
  • 23
  • 27