Rails on Ubuntu – squeaky clean with Passenger!
Getting Ruby Enterprise and Passenger to work took me a few hours. These are the steps that led to a small and squeaky clean installation, ideally suited for a dirt-cheap XEN-based virtual server with only 256 MB of RAM.
apt-get install build-essential apache2-prefork-dev libmysqlclient15-dev
Download latest gz package from here: http://www.rubyenterpriseedition.com/download.html#linux
tar xzvf ruby-enterprise-X.X.X.tar.gz
Run the installer (completely safe, none of your system files will be touched):
./ruby-enterprise-X.X.X/installer
ln -s /opt/ruby-enterprise-1.8.6-20080709 /opt/ruby-enterprise
ln -s /opt/ruby-enterprise/bin/gem /usr/bin/gem
ln -s /opt/ruby-enterprise/bin/ruby /usr/bin/ruby
ln -s /opt/ruby-enterprise/bin/rake /usr/bin/rake
ln -s /opt/ruby-enterprise/bin/irb /usr/bin/irb
ln -s /opt/ruby-enterprise/bin/rails /usr/bin/rails
gem install passenger
/opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.2/bin/passenger-install-apache2-module
Edit your Apache configuration file, and add these lines:
LoadModule passenger_module /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.2/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise/lib/ruby/gems/1.8/gems/passenger-2.0.2
PassengerRuby /opt/ruby-enterprise/bin/ruby
/etc/init.d/apache2 reload
Do not install rails, it is there already!
mysql -u root -p
create database yourapp_development;
create database yourappq_test;
create database yourapp_production;
Configure config/database.yml accordingly
Watch out if you have mod_rewrite enabled, it clashes with Phusion passenger.
Works great. Exactly what I was looking for. Thank you!