How to Install Merb: Use thor to get merb:edge

First install dependencies you’ll probably need

1 sudo gem install erubis rake json_pure rspec rack hpricot mime-types ruby2ruby ParseTree memcache-client templater haml mailfactory sequel mongrel libxml-ruby english addressable builder
      

Install thor

We will use thor to track Merb from git HEAD – which just means that we will keep up with the latest development version.

1 mkdir ~/sources
      2 cd ~/sources
      3 git clone git://github.com/wycats/thor.git
      4 cd thor
      5 rake install
      

1 mkdir ~/sources
2 cd ~
/sou
rces
3 git clone git://github.com/wycats/thor.git
4 cd thor
5 rake install

Install merb.thor file

I like to keep my code projects in their prospective framework/language folder. (i.e. in ~/documents/code/rails are my rails apps and in ~/documents/code/merb are my merb apps). I am going to put the merb.thor file in this merb folder.

1 cd ~/documents/code/merb/sources
      2 curl -L http://merbivore.com/merb.thor > merb.thor
      

Use merb.thor file to install/update merb:edge

First, make sure you have the latest merb.thor file. Run this command again.

1 cd ~/documents/code/merb/sources
      2 curl -L http://merbivore.com/merb.thor > merb.thor
      3 # or alternatively you can run
      4 thor merb:tasks:update
      

1 cd ~/documents/code/merb/sources
2 curl -L http://merbivore.com/merb.thor > merb.thor
3 # or alternatively you can run
4 thor merb:tasks:update

Install/update merb:edge

1 cd ~/documents/code/merb/sources
      2 #sudo thor merb:edge --install #used this previously but now using the 3 following lines so that I get the merb-plugins gems like merb_helpers in there as well.
      3 sudo thor merb:edge:core --install
      4 sudo thor merb:edge:more --install
      5 sudo thor merb:edge:plugins --install
      

1 cd ~/documents/code/merb/sources
2 #sudo thor merb:edge —install #used this previously but now using the 3 following lines so that I get the merb-plugins gems like merb_helpers in there as well.
3 sudo thor merb:edge:core —install
4 sudo thor merb:edge:more —install
5 sudo thor merb:edge:plugins —install

You will get an output similar to this if installing for the first time.

Install datamapper as your orm

Aside:
What is an orm? It’s an object-realtional_mapping tool/language. ActiveRecord is the most well known if you are a rails developer. Datamapper seems to be the current most popular choice for merb developers (but don’t quote me on that. Merb is highly configurable and different orms – like ActiveRecord – might server your particular needs better). However, datamapper is a safe bet for now with it’s goal to be fast, thread-safe and feature rich. Plus, thor supports it. On a final note, if you don’t know which orm to use, use datamapper. It is awesome. Let wycats show you why.

1 cd ~/documents/code/merb/sources
      2 sudo thor merb:edge:dm_core --install
      3 sudo thor merb:edge:dm_more --install
      4 #the following worked on my computer already installed with datamapper, but did not work on a fresh install on a server. Therefore, use the two lines above.
      5 #thor dm:gems:wipe #to clean out any old datamapper gems
      6 #thor dm:clone #to pull down the github datamapper repositories
      7 #cd dm
      8 #thor dm:install #to install the latest datamapper gems
      

However, the most recent Thor file did not install merb_datamapper (Sept 23 2008), therefore I also did:

1 cd ~/sources
      2 git clone git://github.com/sam/dm-more.git
      3 cd dm-more/merb_datamapper
      4 rake install
      

1 cd ~/sources
2 git clone git:
/
/github.com/sam/dm-more.git
3 cd dm-more/merb_datamapper
4 rake install

Also, the most recent data_objects and do_mysql was not installed correctly (I was getting the uninitialized constant DataObjects::URI (NameError) like you see here)so I also did:

1 cd ~/sources
      2 git clone git://github.com/sam/do.git
      3 cd do
      4 rake install
      

1 cd ~/sources
2 git clone git:
/
/github.com/sam/do.git
3 cd do
4 rake install

Picture of Scott Motte

delicious facebook rss twitter

Spitfire Sky | github | archives | resume