Sunday, 16 September 2012

Installing Ruby on Rails on Linux Mint 13

A few months after my last post about installing Ruby on Rails, and much has changed. There was an issue with zlib so I had to flail around a bit. The following instructions are what I think I should have done:
  1. Run "sudo apt-get install zlib1g zlib1g-dev" in a terminal window
  2. Install the Ruby Version Manager (rvm) from these instructions
  3. Run "rvm requirements" in a terminal window
  4. Install all the packages the output of "rvm requirements" tells you to install (apt-get install...). You must do this before you start installing any rubies with rvm. If you don't, you may have all sorts of problems crop up later, like weird messages from irb ("Readline was unable to be required, if you need completion or history install readline then reinstall the ruby.")
  5. Do the following in a terminal window:
rvm install 1.9.3-p194
rvm --default 1.9.3-p194
gem install rails 
sudo apt-get install sqlite 
sudo apt-get install libsqlite3-dev libmysqlclient-dev
sudo apt-get install nodejs 

Now create an application to test:

rails new testapp 
cd testapp 
rails server 

Browse to localhost:3000 and you should see the Rails default page.

2 comments:

Raul Abreu said...

Instead of "rvm 1.9.3-p194" i used "rvm install 1.9.3-p194"

Thank very much! Greatful Tutorial.

Larry Reid said...

Thanks, Raul. I've fixed the line. I'm glad the post helped you.