Easy Merb installation using Thor

There’s now a much simpler way to get Merb setup than I previously noted. By using Thor, either the Stable (Gem) or Edge releases of Merb can be installed as a local Ruby Gem or bundled with your Merb app.

The thor tasks are context aware. Run them in a Merb application directory and they’ll bundle the relevant files with your app; keeping dependencies with the application and making it independent of your system’s Ruby Gems. When run outside any application, they target the system in general (installing as a standard Gem). This is determined by the presence of a local gems directory (or by specifying the --merb-root option).

Installing Edge Merb and DataMapper

mkdir merb; cd merb

# Install Thor
sudo gem install thor

# Get merb.thor file (or update existing file)
curl -L http://merbivore.com/merb.thor > merb.thor
thor merb:tasks:update

# Merb (edge)
sudo thor merb:edge:core --install
sudo thor merb:edge:more --install
sudo thor merb:edge:plugins --install

# DataMapper
sudo thor merb:edge:dm_core --install
sudo thor merb:edge:dm_more --install

Keeping updated with the latest Merb (merb-core and merb-more only) is now simply:

sudo thor merb:edge --install

Further details are given on the merbunity site.


About this entry