How to install Ruby on Rails using Ubuntu

  1. Upon starting the Ubuntu OS, Open Terminal.
    Ubuntu Terminal

  2. Type “sudo apt-get install ruby” <enter>
    Install Ruby

  3. Wait for the installation to be completed.

  4. Placing sources to proper location, go to /usr/src , type “cd /usr/src” <enter> .
    Change directory

  5. Use wget to download needed gem package manager , type “sudo wget” <enter> .
    Download gems

  6. A password prompt will be invoked due to attempt to write files at /usr/src , key in your root password.

  7. Extract the tgz file, type “sudo tar -xzvf rubygems-0.9.4.tgz” <enter> .
    Untar file

  8. Get into the extracted tgz directory, type “cd rubygems-0.9.4” <enter>.

  9. Use ruby to create run and install gem “sudo ruby setup.rb” <enter>.
    Installing Gems

  10. Update gem package manager, type “sudo gem update –system” <enter> .
    Update gem

  11. Install Rails framework and all its dependency(ies), type “sudo gem install rails -y” <enter> .
    Install Rails framework

  12. Go back to your default root, type “cd ~” <enter> .

  13. Create a new file as sample.rb , type “pico sample.rb” <enter> .

  14. In the pico console, type “puts “Hello World!” ” <enter> .

  15. To save and exit, press “Ctrl + X” , press “Y” , press <enter> .

  16. Run the sample ruby program, type “ruby sample.rb” <enter> .
    Running test script

  17. Congratulations, you have successfully installed, ruby, gems and rails framework.

Leave a Reply

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

To prove you're a person (not a spam script), type the answer to the math equation shown in the picture. Click on the picture to hear an audio file of the equation.
Click to hear an audio file of the anti-spam equation

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