last update: 2009-05-01 04:55:14 GMT This book is a work in progress; feel free to contribute.
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).
You will need to install XCode (aka Developer Tools) from the Mac OS X DVD or download it from the Apple developer website.
If you have OS X 10.5 (Leopard), it is likely that you already have Ruby installed.
$ sudo gem install merb
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).
$ sudo apt-get install build-essential libxslt-dev libsqlite3-0 libsqlite3-dev
$ 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
$ sudo gem install merb
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.