The complete stes to install Merb and DataMapper from source

I just started to learn Merb and DataMapper. I installed them with RubyGems, but it raised error because Merb requires DataMapper 0.9.6 but officialy released only 0.9.5. So I decided to install them from source, and found it is hard to install them from source.

The following is the complete steps to install Merb and DataMapper from source.

## install RubyGems 1.2.0 or later
$ tar xzf rubygems-1.2.0.tar.gz
$ cd rubygems-1.2.0/
$ sudo ruby setup.rb

## install dependencies of extlib
$ sudo gem install rake rspec english

## install extlib from source
## (both Merb and DataMapper depend on extlib)
$ git clone git://github.com/sam/extlib.git
$ (cd extlib; sudo rake install)             # extlib-0.9.7

## install dependencies of Merb
$ sudo gem install erubis json_pure rack mime-types hpricot thor
$ sudo gem install ruby2ruby templater haml builder mailfactory mongrel
$ sudo gem install sequel

## install Merb from source
$ git clone git://github.com/wycats/merb-core.git
$ git clone git://github.com/wycats/merb-more.git
$ git clone git://github.com/wycats/merb-plugins.git
$ (cd merb-core; sudo rake install)          # merb-core-0.9.8
$ (cd merb-more; sudo rake install)          # merb-more-0.9.8
$ (cd merb-plugins; sudo rake install)       # merb-xxxx-0.9.8

## install dependencies of DataObject and DataMapper
$ sudo gem install addressable
$ which mysql_config
/usr/local/mysql/bin/mysql_config

## install DataObject from source
$ git clone git://github.com/sam/do.git
$ (cd do/data_objects; sudo rake install)    # data_objects-0.9.6
$ (cd do/do_mysql; sudo rake install)        # do_mysql-0.9.6

## install DataMapper from source
$ git clone git://github.com/sam/dm-core.git
$ git clone git://github.com/sam/dm-more.git
$ (cd dm-core; sudo rake install)            # dm-core-0.9.6
$ (cd dm-more; sudo rake install)            # dm-more-0.9.6

After that, you can type ‘merb-gen app myapp’ and play with them. I hope this helps beginners of Merb and DataMapper.

3 Comments


  1. I was running into similar headaches until I ran across this article (http://merbunity.com/tutorials/18) on Merb’s new bundling functionality.

    To accomplish almost the same thing as you posted above, the following (should) work:
    merb-gen app .
    thor merb:tasks:setup
    bin/thor merb:edge –install
    bin/thor merb:edge:plugins –install
    bin/thor merb:edge:dm_core –install
    bin/thor merb:edge:dm_more –install

    The new thor tasks are pretty awesome once you figure out what’s going on. The ‘–install’ option packages the repository code into the /gems directory. This seems to be just a shortcut for:

    bin/thor merb:source:clone git://example.com/myrepos.git
    bin/thor merb:source:install myrepos

    The default thor tasks did seem to miss some dependencies (like do_mysql).

    Quote | Posted September 25, 2008, 10:23 pm

  2. Hey. Good list of instructions. Have you tried using sake to automate a bunch of this stuff?

    I wrote up some notes here: http://effectif.com/2008/7/14/merb-and-datamapper-on-the-edge

    Cheers…

    Quote | Posted September 25, 2008, 10:25 pm

  3. @eric - thanks for your comments about merb.thor - it’s appreciated!

    I’m happy to inform you that I’ve recently added merb:stable:do and merb:edge:do.

    Both take a an optional argument that specifies a supported DO adapter:

    bin/thor merb:edge:do # install DO
    bin/thor merb:edge:do mysql # install DO and do_mysql

    To get the latest merb.thor, just run merb:tasks:update.

    Quote | Posted September 30, 2008, 8:50 pm

Leave a reply