Master ruby with us

Setup Slice of Slicehost and Deploy Ruby on Rails application

You need to install following software to run the Ruby on Rails application on,
– Ruby
– Rails
– MySQL (or other required database)
– Apache
– Passenger

Here I will explain how to install it on Slicehost server,

Ruby Installation (includes Subversion and RubyGems as well),
sudo apt-get install ruby rubygems ruby1.8-dev build-essential libmysql-ruby irb subversion libapr1-dev

Rails Installation,
sudo gem install rails
To install particular Rails version,
sudo gem install -v= rails

Latest Rubygems Installation,
cd /usr/local/src
tar -xzvf rubygems-1.3.5.tgz
cd rubygems-1.3.5
sudo ruby setup.rb --no-format-executable --no-ri --no-rdoc

MySQL Installation on Slicehost,
sudo apt-get install mysql-server
sudo apt-get install mysql-client libmysql-ruby libmysqlclient15-dev

Apache Installation on Slicehost,
sudo apt-get install apache2
sudo /etc/init.d/apache2 restart //Restart Apache
sudo apt-get install apache2.2-common apache2-mpm-prefork apache2-prefork-dev -y

Install Passenger on Slicehost,
sudo gem install passenger
sudo apt-get install libopenssl-ruby //(for SSL Support)
sudo passenger-install-apache2-module

Now add following in /etc/apache2/apache2.conf (add at the bottom),
LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5/ext/apache2/
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.5
PassengerRuby /usr/bin/ruby1.8

You can change the Passenger version as per yours.

Restart Apache for Passenger configuration,
sudo /etc/init.d/apache2 restart //Restart Apache

Your slice is ready to deploy the Rails application. I will add more information regarding GIT Installation and Deployment using Capistrano tomorrow.


I’m ready to hear comments, suggestions or troubles !


Leave a Reply

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

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

Google+ photo

You are commenting using your Google+ 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 )


Connecting to %s

%d bloggers like this: