firstruby

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 Slicehost.com,
– Ruby
– Rails
– MySQL (or other required database)
– GIT/SVN
– 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
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
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/mod_passenger.so
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.

Cheers..

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

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

 
%d bloggers like this: