Archive for March, 2011

Routes in Rails 3

25 Mar

This is cool stuff. Nuff said. See more here:


Installing Ruby 1.9.2 & Rails 3 on Ubuntu with a single command

07 Mar

I wrote a script that installs Ruby 1.9.2 with RubyGems, Rails 3 and sqlite on Ubuntu with a single command. This script makes it very easy to get started developing Rails applications on Ubuntu. Its also an easy way for non-ruby developers to run popular Rails applications.

This is a script I originally wrote, a while ago for Ruby 1.8.7 and Rails 2, I recently realized that most of the traffic coming to my blog were people looking to setup Rails on Ubuntu. So I decided to update the script for Rails 3 and Ruby 1.9.2. So please enjoy.

I remember about 2 years ago, when I got kicked out of a shared hosting account because I was using too much CPU time, I was forced to move my high traffic web service to EC2. I was still new to Linux, it was my first time deploying a Rails app in production, and I was going to go live with thousands of users instantly. It was a nightmarish weekend. That’s why I write scripts like this, to help new users from Windows and OS X get comfortable with the Linux world.  Although Ubuntu 10 is much easier than 8.10, and Ruby 1.9.2 is a big improvement, Rails 3 with bundler is also a big relief, this is a script I wish I had 2 years ago while deploying my first Rails app.

Assumptions Made by the script

The script assumes you don’t have an older version of Ruby like (1.8.7) installed on the system. If you already have an older version of Ruby installed, use RVM instead of this script. To check if you have an older version of Ruby installed type

ruby -v

Installing and setting up Rails with a single command

Step 1: Install Git if you don’t already have it

 sudo apt-get install git-core

Step 2: Download the script from Github

 git clone git://

Step 3: Change to the speedtrain directory (the script is called speedtrain)

 cd speedtrain

Step 4. Make the script executable

 chmod +x speedtrain

Step 5. Run the script


This will install Ruby 1.9.2,RubyGems, Rails 3 and Sqlite. It will create a folder in your $HOME directory for your Apps called rails_apps. It will also create a sample Rails App called testapp.

To run the sample Rails app. Type…

 cd $HOME/rails_apps/testapp
 rails server

To view the app, open a browser and type http://localhost:3000/

To create a new Rails app. Type..

 cd $HOME/rails_apps
 rails new myapp

Who should use this script

  • Rubists from MS Windows and OS X getting into Ruby/Rails/Linux
  • Non-Rubists that need to run Rails apps on Ubuntu
  • Newcomers to the Ruby/Linux World
  • Rubists that only need Ruby 1.9.2

Related Posts:

Ubuntu, Ruby, RVM, Rails and You

Source code for the script:

Premium Wordpress Plugin