Home > Applications, Ubuntu > Installing Ruby on Rails in Ubuntu 8.04(Hardy)

Installing Ruby on Rails in Ubuntu 8.04(Hardy)

January 31st, 2009

Ruby on Rails is a web application programmers based on Ruby. It helps the programmers creat best web applications easily.

Here are the steps to set up Ruby on Rails in your Ubuntu or Debian based systems

Step 1: First step is to install some inportant packages that are recured,

sudo apt-get -y install build-essential libssl-dev libreadline5-dev zlib1g-dev

Step 2: Install ruby

RUBY="ruby-1.8.6-p111" //Current stable version

wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/$RUBY.tar.gz

tar xzf $RUBY.tar.gz cd $RUBY

./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr –with-zlib-dir=/usr

make clean

make

make install

make install-doc

make clean will clear any make files in that folder, previosly created that was configured without right options Checking whether ruby is installed properly

ruby -ropenssl -rzlib -rreadline -e "puts :success"

Step 3: Install Gem

Gem is a installer similar to apt, for ruby and ruby related packages

RUBYGEMS="rubygems-1.0.1" //Current stable version
wget http://rubyforge.org/frs/download.php/29548/$RUBYGEMS.tgz
tar xzf $RUBYGEMS.tgz
cd $RUBYGEMS
/usr/local/bin/ruby setup.rb
	

Step 4: Install Rails

gem install rails //This will install rails successfully.

Or gem install <paths to rails gem file>

Main Errors during Installation:

Error 1:

/usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require’: no such file to load — zlib (LoadError)

using the following step for configuring ruby, that is before make, will remove this problem

./configure --prefix=/usr/local --with-openssl-dir=/usr --with-readline-dir=/usr –with-zlib-dir=/usr

Error 2:

no such file to load — mysql

undefined symbol: rb_Digest_MD5_Init – /usr/local/lib/ruby/1.8/i686-linux/digest/md5.so (LoadError)

Installing the mysql dev package and mysql library for ruby will clear this error,

sudo apt-get install libmysqlclient15-dev

sudo gem install mysql

Rosario Applications, Ubuntu

  1. turco
    turco
    December 23rd, 2009 at 06:49 | #1

    thanks… your how-to worked great on debian squeeze/sid.. i can now get on working!

  1. No trackbacks yet.