marvalle shares

@alfredoramosv

5 notes

Installing Ruby on Rails on Centos 5.6

First erase old versions of ruby (comes with 1.8.5):

sudo yum erase ruby ruby-libs ruby-mode ruby-rdoc ruby-irb ruby-ri ruby-docs

Since Rails uses sqlite for its test applications install it:

yum install sqlite

Then install all tools needed for ruby dev:

sudo yum install openssl-devel zlib-devel \

gcc gcc-c++ make autoconf readline-devel \

curl-devel expat-devel gettext-devel

Download the latest ruby from http://www.ruby-lang.org/en/downloads/ and untar it and go into the directory to configure/install it:

./configure —enable-shared —enable-pthread —prefix=/usr

make

sudo make install

Now install rails:

gem install rails

At this point I had some problems with not having sqlite linked properly, and since I’m not going to restart the build this is what I did:

Finally, test the install by creating a test app:

rails new testapp

cd testapp

ruby script/rails server

At this point I had some problems with not having sqlite linked properly, and since I’m not going to restart the build this is what I did:

yum install ruby-devel

yum install sqlite-devel

#note: sqlite-devel is the important one since it has sqlite3.h

bundle install

Now I’m thinking, boy this is annoying what does this error message mean:

sqlite3-ruby only supports sqlite3 versions 3.6.16+, please upgrade!

Ok then I will ugrade sqlite3. I download the source from here http://www.sqlite.org/sqlite-autoconf-3070603.tar.gz and proceed to configure/make/makeinstall.
Voila:

Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Let’s proceed:

ruby script/rails server

Now that your web server is up and running, open your browser and hit it on port 3000 - you should be good to go. 

Hope this helped!

-marv

Filed under 2011 aws centos 5.6 ruby 1.9.2 ruby on rails sqlite3 sqlite3.h sqlite3 versions 3.6.16+

  1. azrad reblogged this from marvalle
  2. marvalle posted this