Skip to content

Instantly share code, notes, and snippets.

@plindberg
Created May 25, 2011 12:58
Show Gist options
  • Save plindberg/990919 to your computer and use it in GitHub Desktop.
Save plindberg/990919 to your computer and use it in GitHub Desktop.
Installing Ruby 1.9.2 via RVM, RubyGems, and Passenger on Debian 5.x (for Rails 3.1 deployment)

Install needed packages

apt-get update
apt-get install build-essential bison openssl libreadline5 libreadline5-dev \
  curl git-core zlib1g zlib1g-dev libssl-dev libyaml-dev libsqlite3-0 \
  libsqlite3-dev sqlite3 libxml2-dev libxslt-dev autoconf libc6-dev ncurses-dev

Install RVM

bash < <(curl -s https://rvm.beginrescueend.com/install/rvm)
echo '[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm" # Load RVM function' >> ~/.bash_profile
source ~/.bash_profile

Install Ruby 1.9.2

Apparently, you need to first install 1.8.7.

rvm install 1.8.7
rvm use 1.8.7
rvm install 1.9.2
rvm use 1.9.2 --default

Install RubyGems

curl -OL http://rubyforge.org/frs/download.php/74886/rubygems-1.8.3.tgz
tar zxf rubygems-1.8.3.tgz
cd rubygems-1.8.3/
ruby setup.rb

The following line gets rid of deprecation warnings, should you get those.

gem pristine --all --no-extensions

Finally, make bundler available to all gemsets.

rvm use 1.9.2@global
gem i bundler

Install Passenger

Install whatever the Passenger install script asks you to.

gem i passenger
passenger-install-apache2-module

At the end, the install script gives you three lines for your Apache config. Put the first line into mods-available/passenger.load in the Apache 2 directory, and the other two into passenger.conf in the same directory (wrapped in <IfModule mod_passenger.c> if you like). Then enable it.

a2enmod passenger
/etc/init.d/apache2 restart
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment