Why Update Rails
Mac OS X Leopard ships with Rails 1.2.6 which was the latest version when the OS released. But the rails team has updated Ruby on Rails to version 2.0 (2.0.2 now to be exact). Version 2 of rails brings many new features, updates and fixes. To get your Mac running the latest version of rails, open the terminal and run the following commands
Commands
$ sudo gem update --system
$ sudo gem install rails
$ sudo gem update rake
$ sudo gem update sqlite3-ruby
You have to run the commands with the sudo prefix to run them as the super user (equivalent of admin) or you will get a the following error
You don’t have write permissions into the /usr/bin directory.
Commands Explained
$ sudo gem update –system - this command updates the ruby gems package manager (this update is required by the latest version of rails)
$ sudo gem install rails - updates and installs the latest version of rails including the dependencies
$ sudo gem update rake - updates the rake tool which is used by rails
$ sudo gem update sqlite3-ruby - updates the ruby sqlite3 bindings, you can skip this command if you don’t use sqlite as your database
Testing
You will get visual updates as the update process goes on but if you still feel like testing the update once you are done, type this command in the terminal
$ rails -v
and to get a list of all the gems currently installed on your mac displayed with their version numbers use the following command
$ gem list
If you have any other suggestions or questions about the update, write a comment.