Coming home to Merb

October 31st, 2008 Merb

The highlight of RailsConf 2007 for me was discovering Merb on the plane ride up to Portland.

I remember reading the router code and thinking, wow, I can understand this (as opposed to alias_method_chain madness of Rails)! I wrote a sample app and enjoyed playing with this new framework.

Fast-forward to today and my life has been mainly consumed with my startup which is written in Rails. I love Rails but I've had the Merb itch ever since...

Luckily a recent micro app allowed me to reacquaint myself with Merb.

Here are a few notes I made while deploying a merb app to Debian Etch using Capistrano and Passenger.

Apache & Passenger

$ sudo apt-get install apache2 apache2-prefork-dev
$ sudo gem install passenger
$ sudo passenger-install-apache2-module

Add to /etc/apache2/apache2.config

LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3/ext/apache2/mod_passenger.so
PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.0.3
PassengerRuby /usr/bin/ruby1.8

Create /etc/apache2/sites-available/myproject

<VirtualHost *:80>
  ServerName www.myproject.com
  DocumentRoot /var/www/apps/myproject/current
</VirtualHost>

Enable site

$ sudo a2ensite myproject
$ sudo /etc/init.d/apache2 restart

Capistrano

deploy.rb

$ sudo deploy

Other details

I installed all gems locally for the app like:

$ gem install -i gems/ merb-core --no-ri --no-rdoc
$ gem install -i gems/ rest-client --no-ri --no-rdoc
...

config.ru

That's it. Passenger was super easy to install and configure.

Thanks to Ezra for hacking up Merb way back when and to all the core team for making Merb a very viable and solid framework.

--- --- ---

Commenting is closed for this article.