Deploying Rails Apps on Various Linuxes

Posted by SibProgrammer on January 10, 2010|Comments

During preparation of automatic installer for OpenVZ Web Panel product I tried to solve the problem of deploying Rails app on various Linux-like systems.

Ubuntu/Debian

Due to fact that I have a lot of servers with Ubuntu and Debian with Rails apps, the deployment was easy. The following command solves dependencies for typical application (for my app as example):

apt-get install ruby rubygems libsqlite3-ruby libopenssl-ruby rake

During test cycle I checked the command on Ubuntu 8.04, Ubuntu 9.04 and Debian 5.

Fedora

Deployment on Fedora 12 server was also easy. Command for solving dependencies:

yum install ruby rubygems ruby-sqlite3 rubygem-rake

CentOS

The most of headache give me the attempts to deploy Rails app on CentOS 5 server. First of all need to install ruby:

yum install ruby

Then I didn’t find RubyGems as a package, so install it manually:

yum install ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc
wget -nc -P /tmp/ $RUBYGEMS_URL
tar -C /tmp/ -xzf /tmp/$ARCHIVE_NAME
ruby /tmp/$DIR_NAME/setup.rb

The next step was to install necessary rake:

gem install rake

Installation of sqlite3 support is more complicated:

yum install sqlite-devel make gcc
gem install sqlite3-ruby --version '= 1.2.4'