Installation Steps for Ruby on Rails

Steps to install Ruby on Rails

1) Setting up the Rails development environment

Ruby, rubygems, rails and other required packages can be installed by :

  1. sudo apt-get install build-essential
  2. $ sudo apt-get install ruby-full
  3. $ cd Downloads
  4. $ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
  5. $ tar xzvf rubygems-1.8.24.tgz
  6. $ sudo mv rubygems-1.8.24 /usr/local/src
  7. $ cd 
  8. $ cd /usr/local/src
  9. $ cd rubygems-1.8.24
  10. $ sudo ruby setup.rb
  11. $ sudo update-alternatives –install /usr/bin/gem gem /usr/bin/gem1.8 1 
    If you got error in this step (ERROR: update-alterntives:error: unknown argument ‘–install’),   then retype ‘–‘ (Two Hyphens) before install
  12. $ sudo gem install rails

2) Setting up MySQL Database

If you have already installed Mysql then ignore this step.

$ sudo apt-get install mysql-server

Well you have now install Ruby on Rails ,Now its time to test it. So Create a Rails’s application .Here name of Rails application is new ,you can give your own name.

Go to place where you want to create Ruby on Rails application and run these commands in terminal :

rails new
cd new
rails server

The rails server command launches a small web server named WEBrick which comes bundled with Ruby. You’ll use this any time you want to view your work through a web browser.
This command will give you the following output in terminal

=> Booting WEBrick => Rails 3.0.0 application starting in development on http://0.0.0.0:3000 => Call with -d to detach => Ctrl-C to shutdown server [2010-04-18 03:20:33] INFO WEBrick 1.3.1 [2010-04-18 03:20:33] INFO ruby 1.8.7 (2010-01-10) [x86_64-linux] [2010-04-18 03:20:33] INFO WEBrick::HTTPServer#start: pid=26086 port=3000

With just three commands we whipped up a Rails server listening on port 3000. Go to your browser and open http://localhost:3000, you will see a basic rails app running.
Congratulations ,You are now running Ruby on Rails.
If you want to stop server then Press Ctrl+C in terminal

Continue to Configuring the Database in Ruby on Rails.

One thought on “Installation Steps for Ruby on Rails

Leave a Reply

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