Tuesday, December 4, 2007

Installing Rails on uBuntu 7.10 Gusty Gibbons


So I wanted to install Ruby on Rails on my new linux box. And really thats not tough, this post just guides you to do the same. Actually I feel it is 80% easier to setup your linux box for any programming language than a windows COMPUTER. I might be wrong cause I used Windows for about a decade and then its a little more than one year since I have been using uBuntu (DUH!! a linux distro for the ones that didnt know) and I am already in love with it. One year and it still hasn't crashed. I can go on and on about my love for uBuntu but I think I will stop here. Ohh BTW uBuntu 7.10 (or uBuntu Gusty Gibbons has launched). It is sooooo light and awesome looking that my mom also is telling me to install it on her laptop. Truly linux for human beings. But I think I will let her laptop be a dual boot with XP and uBuntu; It will help me test my web apps.

Coming back to the main topic of discussion, I need to install Rails on uBuntu (actually works well for debian too). So here are few basic steps you might want to review:
1) Make sure all the build essentials are present on your Linux box. If not then quickly get into the terminal and hit

sudo apt-get install build-essential

2) Next you need to install ruby ri and rdocs so hit
sudo apt-get install ruby ri rdoc

3) Now you would want to download the latest versions of RubyGems; you could do that from http://rubyonrails.org/down or hit
sudo wget http://rubyforge.org/frs/download.php/11289/rubygems-0.9.0.tgz

4) Uncompress and extract the file by
tar -xvzf rubygems-0.9.0.tgz

5) Go into that folder by
cd rubygems-0.9.0

6) execute the setup.rb file to setup RubyGems
sudo ruby setup.rb

7) Use RubyGems to install Rails
sudo gem install rails --include-dependencies

8) If the previous step gave you an error about SSL then install the Open SSL library for ruby
sudo apt-get install libopenssl-ruby


And you are ready to go!!! Lets test the Rails setup by creating a demo project and running it (remember you are still in the terminal)
$ rails testapp
$ cd testapp
$ ruby script/server

/testapp$ ./script/server
=> Booting WEBrick…
=> Rails application started on http://0.0.0.0:3000
=> Ctrl-C to shutdown server; call with --help for options
[2006-12-07 05:28:37] INFO WEBrick 1.3.1
[2006-12-07 05:28:37] INFO ruby 1.8.4 (2005-12-24) [i486-linux]
[2006-12-07 05:28:37] INFO WEBrick::HTTPServer#start: pid=6687 port=3000



You’ll notice that the server is listening on port 3000. Open up a browser, and go to http://localhost:3000. Ok this is it for this article hope you are successful in setting up Rails on your Linux box and I wish your app gets as famous as David's. Peace.








=================================================
||My FREE services||

Find out more information about domain parking at ParkingWHOIS
=================================================

2 comments:

Warlock handleR said...

If you need mkmf. It's located in the ruby1.8-dev package :

sudo apt-get install ruby1.8-dev

Warlock handleR said...

If you get an error while u execute gem then look into usr/bin/ and mv the gem to gem_bak and cp the gem1.8 to gem

this is generally the case with Ubuntu