last update: 2009-05-01 04:55:14 GMT This book is a work in progress; feel free to contribute.

The Merb Open Source Book
Français | 한국어 | 日本語 | Português | Deutsch | 中文 | Español | Русский | Bosanski | Nederlands | العربية | Български | Italiano

Install instruction

You will need to install Merb in order to use the framework. However, before installing Merb, you will need to have installed a C compiler, Ruby and RubyGems, and a database (if you want to persist your models).

OS X

Prerequisites

You will need to install XCode (aka Developer Tools) from the Mac OS X DVD or download it from the Apple developer website.

Ruby & RubyGems

If you have OS X 10.5 (Leopard), it is likely that you already have Ruby installed.

Merb

$ sudo gem install merb

Linux

The following instructions are for Debian-based distributions (Ubuntu, for example), which uses the apt-get package manager. If you are using a different distribution, use that distribution’s package manager (for example, RedHat systems use yum as its package manager).

Prerequisites

$ sudo apt-get install build-essential libxslt-dev libsqlite3-0 libsqlite3-dev

Ruby & RubyGems

$ sudo apt-get install ruby ruby1.8-dev rdoc irb libyaml-ruby libzlib-ruby ri \ 
  libopenssl-ruby libxml-ruby

$ wget "http://rubyforge.org/frs/download.php/45905/rubygems-1.3.1.tgz"
$ tar -xvzf rubygems-1.3.1.tgz
$ rm rubygems-1.3.1.tgz
$ cd rubygems-1.3.1
$ sudo ruby setup.rb
$ cd ..
$ rm -r rubygems-1.3.1
$ sudo ln -s /usr/bin/gem1.8 /usr/bin/gem
$ sudo gem update --system

Merb

$ sudo gem install merb

Windows

Windows users have a couple of options for installing Ruby and RubyGems. One way is to download the Ruby binaries, install them, and then install RubyGems.

An alternative is to use the One-Click Ruby Installer which (as well as a few other things) comes packaged with RubyGems. If you use the One-Click Installer, make sure you check the “Enable RubyGems” box in the install wizard.

By default, it will install Ruby in the C:\Ruby directory. Once installed, do the following:

Start –> Programs –> Ruby-<version> –> RubyGems –> RubyGems Package Manager

This will open a command prompt in the C:\Ruby directory and display some usage information. Then it’s just a simple matter of installing Merb:

C:\Ruby> gem install merb

This command might take a couple of minutes to run, because it must update the gem cache, fetch all Merb-related gems, and then install them.

Note: If you want to use SQLite database (which is the default), you must download and install it separately. More information can be found on the SQLite site.