domingo, 8 de agosto de 2010

Installing RVM and Rails 3 RC

This is my first attempt to install Rails 3 RC following the pattern suggested by many users, i.e. managing several Ruby versions according to Rails 3 requirements.
First of all this is my environment: OS X 10.6.4 ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
1. Installing RVM
1.1 Run the following command on the terminal:
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
After the installation you'll see a bunch of messages fetching, installing and configuring RVM. 1.2 Configure your environment: Add this line to your .profile for correct rvm command usage:
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
and run the source command to load the new code
source ~/.rvm/scripts/rvm

2. Install Ruby through RVM
This is a pretty straightforward installation if the above steps were done correctly. First run this command:
rvm install 1.9.2
The above will install ruby 1.9.2-RC the latest stable version. But if you like you can install the edge version with the following command:
rvm install 1.9.2-head
After many many cpu cycles, you can run the following to see the final result:
$ rvm list

rvm rubies

   ruby-1.9.2-head [ x86_64 ]
   ruby-1.9.2-rc2 [ x86_64 ]
To change between version use the following:
$rvm 1.9.2		<-- RC


$rvm 1.9.2-head <--latest version


$rvm system <--original version
Prepare the system for installing Rails 3 RC. First set the default ruby to be used, then I recommend installing Rails in the global gemset of the desired Ruby, i.e. if you choose 1.9.2-head then do:

$ rvm 1.9.2-head --default
$ rvm 1.9.2-head@global

This will organize things a little more by having Rails globally (for the Ruby version specified) and if you like you can change to the default gemset or create another one for your own purposes:
$ rvm 1.9.2-head   <--default gemset
$ rvm use 1.9.2-head@experiment --create  <--gemset called "experiment"
The benefits of installing Ruby on the global gemset is that in this way is visible to all other gemsets.
2. Install Rails in the gemset specified Now that you configured RVM, it's time to install Rails 3 RC globally with the usual command:
$ rvm 1.9.2-head@global
$ gem install rails --pre
This will install Rails 3 on the gemset global and should be visible to all other gemsets of 1.9.2-head that you wish to create.

No hay comentarios:

Publicar un comentario