As I’m going to start a new project using Ruby on Rails and I just found Rails just released a new version as 3.1.0 Release Candidate 4 and will be out as an official release in a few weeks if everything goes well.
Well, I’m going to use my Mac mini as the primary machine to work on this project as it is a hobby project. (anyway, I have a strategy to make money for me as well)
So, the problem is Mac OS X snow leopard already bundled with Ruby 1.8.7 and we need to upgrade it to version 1.9.2.
First, we need to download the source code of Ruby 1.9.2, compile, install and install Rails 3.
Here is detailed instructions.
You need to install readline.
curl -O ftp://ftp.cwru.edu/pub/bash/readline-6.0.tar.gz tar -xvzf readline-6.0.tar.gz cd readline-6.0 ./configure --prefix=/usr/local make sudo make install
Don’t concern on some warning, just make sure there is no error.
Next, you need to download Ruby 1.9.2 from http://www.ruby-lang.org/en/downloads/
Extract the archive, open a terminal and go to the extracted directory.
Then, execute these lines.
./configure --prefix=/usr/local --enable-pthread --with-readline-dir=/usr/local --enable-shared make sudo make install sudo make install-doc
Then, you need to add this line into your “~/.bash_profile” file. (create a new one if it doesn’t exists)
Close the terminal, open the new one, then check Ruby version using this command.
You will see it is now version 1.9.2!
Bingo, now just install RubyGems, or if installed, execute this command.
gem install rails --pre
–pre state that you want to install a pre-release version which is RC.
So, if Rails 3.1.0 is already an official version, you can ignore –pre parameter.
Hope this help.