Installing Ruby on Rails on Debian/Ubuntu

Ruby on Rails
Ruby on Rails is an open source web framework for developing database backed web applications. It is optimized for sustainable productivity of the programmer since it lets the programmer to write code by favouring convention over configuration.


  1. Make sure Apache 2 and MySQL already installed
  2. Install build-essential, paste code below in your console
    sudo apt-get install build-essential
  3. Install Ruby and others components
    sudo apt-get install ruby ri rdoc irb ruby-dev libruby libmysql-ruby libopenssl-ruby libmysqlclient-dev sqlite3 libsqlite3-ruby libsqlite3-dev
  4. Install RubyGems
    sudo apt-get install rubygems
  5. Install Rails
    sudo gem install rails
  6. Install Mongrel-Cluster
    sudo gem install mongrel_cluster
  7. Install mysql and sqlite3 gem
    sudo gem install mysql sqlite3-ruby
  8. For optional I add this command to create symbolik link
    sudo ln -s /var/lib/gems/1.8/bin/rails /usr/bin/rails
    sudo ln -s /var/lib/gems/1.8/bin/rake /usr/bin/rake

Now test your installation, create rails applications with this command

rails testapp
cd testapp/

Then open http://localhost:3000, if successful will be the default screen out Ruby on Rails.

Note :

  • Command above will create rails application using SQlite3 database
  • if you will create rails application using mysql database, change your command with
    rails -d mysql <nameapplication>