Install Rails 3 on Ubuntu 10.04 Lucid Lynx Using RVM with Mysql and sphinx

First install ‘curl’ and ‘git’

  • step 1: install curl
    $ sudo apt-get install curl
  • step 2: install git
    $ sudo apt-get install git-core
  • Then install RVM

  • step 3: install rvm
    $ bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head )
  • step 4: edit .bashrc file to load rvm into the shell session
    $ gedit .bashrc
    Add the following line to the end of the file:
    if [[ -s “$HOME/.rvm/scripts/rvm” ]] ; then source “$HOME/.rvm/scripts/rvm” ; fi
  • step 5 : restart linux
    $ sudo reboot
  • step 6 : type
    $ rvm notes
    In the notes RVM tells you what packages you’re gonna need to install for various flavors of Ruby. Since we’re going with 1.9.2 we want the packages it lists under the MRI & ree section. Let’s install those now.
    $ sudo aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core subversion autoconf
  • Install Ruby 1.9.2

  • step 7 : install ruby 1.9.2 through rvm
    $ rvm list known
    $ rvm install 1.9.2-head
    for 64bit:
    $ rvm install 1.9.2
  • step 8 : make ruby 1.9.2 as default
    $ rvm –default ruby-1.9.2-head
    for 64bit:
    $ rvm –default ruby-1.9.2
    check ruby version
    $ ruby -v
  • Install Rails 3

  • step 9 : Install rails 3
    $ gem install i18n tzinfo builder memcache-client rack rack-test rack-mount erubis mail text-format thor bundler
    $ gem install rails –pre
  • Select your database

  • step 10 : Install database
    For Sqlite3
    $ sudo apt-get install sqlite3 libsqlite3-dev
    $ gem install sqlite3-ruby
    (OR)
    $ sudo apt-get update
    For Mysql goto synaptic package manager and type
    mysql-server, mysql-client and install and set password.
    Install mysql client libraries :
    $ sudo aptitude install libmysqlclient16-dev
    or
    $ sudo apt-get install libmysql-ruby libmysqlclient-dev
  • Install Sphinx

  • If you want sphinx, install Sphinx
    $ wget http://sphinxsearch.com/downloads/sphinx-0.9.8.1.tar.gz
    $ tar xzvf sphinx-0.9.8.1.tar.gz
    $ cd sphinx-0.9.8.1/
    $ ./configure
    $ make
    $ sudo make install
  • To know about sphinx type
    $ search

If you are getting error when starting sphinx make sure that the ‘indexer’,’searchd’,’search’ is under /usr/local/bin or under where sphinx specifies.
You are now ready to go…

Advertisements

Author: Abhi

Hi, this is Abhilash - Senior Programmer Analyst at CoMakeIT, specialised on web programming. Mainly working on Ruby On Rails platform since 2010.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s