Moving Notice

This blog has been moved to http://kill3rmedia.com/blog/ . Comment posting has been disabled in this blog (please leave comments at new address..) Sorry for the inconvenience guys..


Friday, January 25, 2008

RAILS on Ubuntu 7.1

Windows platform may not be the ideal place to develop or deploy your Apache/MySQL/PHP or RoR(Ruby on Rails) applications. However I came across few problems myself trying to setup Ruby on Rails Development Machina on Linux (Ubuntu 7.10). Once you fix them, it works like a charm

There are many installation instructions and fixes posted everywhere. I thought of putting my own version to consolidate installation instructions and fixes to possible problems. I've also listed the sources I've referred myself and its recommended visit those websites if you need more detailed instructions as well as up-to-date news.

POSSIBLE ISSUES

  • rubygems (LoadError) require’: no such file to load – rubygems (LoadError)
  • MySql socket error No such file or directory - /tmp/mysql.sock
  • Open ssl problem when starting Webrick server

1. Install libopenssl-ruby1.8 » fixes the Webrick server error on startup

2. Install
libmysqlclient15-dev » fixes the MySQL sock not found issue
Reference:
https://help.ubuntu.com/community/RubyOnRails

3. Install
Ruby and Gems
Even though you can easily get ruby installed using apt-get it doesn't fix the issue. We'll have to compile it ourselves.
Reference:
http://www.thirdbit.net/articles/2007/10/04/installing-ruby-186-on-ubuntu-feisty-fawn-704/
http://www.urbanpuddle.com/articles/2007/08/17/mongrel-cluster-1-0-2-and-ruby-1-8-5
http://www.urbanpuddle.com/articles/2008/01/09/install-ruby-on-rails-on-ubutu-gutsy-gibbon-apache-version

  1. Download ruby
  2. tar xjvf ruby-1.8.6.tar.bz2
  3. cd ruby-1.8.6
  4. sudo apt-get build-dep ruby1.8
  5. ./configure --prefix=/usr
  6. make
  7. sudo make install
  8. ruby -v and if you see something like ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-linux] ruby is installed :)
  9. then we install ruby gems. download rubygems and extract it.
  10. cd rubygems-1.0.1
  11. sudo ruby setup.rb

4. Install Rails
Reference:
http://rubyonrails.com/down
http://rubyonrails.com/

sudo gem install rails --include-dependencies

We are done.. Worked for me, and fingers crossed it'll work for anyone as well :)

2 Comments:

Anonymous said...

Thanks for the post. Very to the point.

Worked like a charm but need to do

sudo gem install rails --include-dependencies

DareDevil said...

thanks.. added "sudo" to the command