I am going to give Ruby on Rails a whirl over the next couple of months, so I built a CentOS 5.3 virtual machine to try it out on. This post deals with the installation and getting a simple application to work.
I am going to install ruby from source- which may not be optimal from a maintenance standpoint.
First install the pre-requisite packages:
> sudo yum install gcc zlib zlib-devel openssl-devel -y
Then download, compile, and install ruby (1.8.7 is the latest as of this post). I am installing it into my $HOME/ruby directory and will add that to my path:
> mkdir ruby; cd ruby
> wget ftp://ftp.ruby-lang.org/pub/ruby/1.8/ruby-1.8.7.tar.gz
> tar xzvf ruby-1.8.7.tar.gz
> cd ruby-1.8.7
> ./configure –prefix=$HOME/ruby –enable-pthreads
> make
> make install
> cd ext/openssl
> ruby extconf.rb
> make
> make install
Now we need RubyGems. 1.3.3 is the latest as of post time
> cd ruby
> wget http://rubyforge.org/frs/download.php/56227/rubygems-1.3.3.tgz
> tar xzvf rubygems-1.3.3.tgz
> cd rubygems-1.3.3
> ruby setup.rb
> gem install rails –include-dependencies
> gem install termios –include-dependencies
> gem install mongrel –include-dependencies
> gem install mongrel-cluster –include-dependencies *no mongrel-cluster?*
> gem install capistrano –include-dependencies
> gem install mysql *holding on mysql install*
Test your rails installation:
> cd $HOME
> mkdir projects
> rails myrailsapp
> cd myrailsapp
> ruby script/server
The simple application should now be running on localhost port 3000. Fire up your web browser and browse away.
My first Rails application is running and it didn’t take that long. Then again- it does very little.