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.

Installation

  1. Make sure Apache 2 and MySQL already installed
  2. Install build-essential, paste code below in your console
    [bash]
    sudo apt-get install build-essential
    [/bash]
  3. Install Ruby and others components
    [bash]sudo apt-get install ruby ri rdoc irb ruby-dev libruby libmysql-ruby libopenssl-ruby libmysqlclient-dev sqlite3 libsqlite3-ruby libsqlite3-dev[/bash]
  4. Install RubyGems
    [bash]
    sudo apt-get install rubygems
    [/bash]
  5. Install Rails
    [bash]
    sudo gem install rails
    [/bash]
  6. Install Mongrel-Cluster
    [bash]
    sudo gem install mongrel_cluster
    [/bash]
  7. Install mysql and sqlite3 gem
    [bash]
    sudo gem install mysql sqlite3-ruby
    [/bash]
  8. For optional I add this command to create symbolik link
    [bash]
    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
    [/bash]

Now test your installation, create rails applications with this command
[bash]
rails testapp
cd testapp/
script/server
[/bash]
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
    [bash]rails -d mysql <nameapplication>[/bash]

5 thoughts on “Installing Ruby on Rails on Debian/Ubuntu

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.