Install ruby 1.9, rails 3.2, mysql 5.1 on ubuntu 10.04

Hey all

Now most of us are working on rails 3.2.X I thought of posting about how to configure the same along with mysql server 5.1 on a Ubuntu server.

As always the first step will be to install essentials utilities.

Prerequisites

apt-get update
apt-get install aptitude
aptitude install build-essential

Now some prerequisities for ruby

sudo apt-get -y install libc6-dev libssl-dev libmysql++-dev libsqlite3-dev make build-essential libssl-dev libreadline5-dev zlib1g-dev

Now we will move to step #2

Install Ruby 1.9.2 from source

so first download the source using

wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.2-p290.zip

than install unzip using

apt-get install unzip
unzip ruby-1.9.2-p290.zip
cd ruby-1.9.2-p290
./configure –prefix=/usr/local
sudo make && sudo make install

Now check if ruby got installed properly or not using ruby -v command it should show you ruby 1.9.2p290

Install mysql 5.1
sudo apt-get install mysql-server-5.1

Install Rails and essential gems
sudo gem install mysql2 rails rack rake mysql

Doing this if you get an error about UTF-8 just run the following command

export LC_ALL=”en_US.UTF-8″

I guess thats all now create your rails app using

rails new new_rails_app -d mysql

Later if you want to configure it using Apache visit my previous post on

http://blog.dhavalparikh.co.in/2012/06/deploying-rails-app-using-apache-and-passenger-on-ubuntu/

Let me know if you face any issues in any of the steps above and I shall be happy to guide you.

Be Sociable, Share!

One comment

Leave a Reply

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