Posts Tagged ‘install’

|

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

First install dependencies you’ll probably need

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.

mkdir ~/sources
cd ~/sources
git clone git://github.com/wycats/thor.git
cd thor
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.

cd ~/documents/code/merb/sources
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.

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

Install/update merb:edge

cd ~/documents/code/merb/sources
#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.
sudo thor merb:edge:core --install
sudo thor merb:edge:more --install
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.

cd ~/documents/code/merb/sources
sudo thor merb:edge:dm_core --install
sudo thor merb:edge:dm_more --install
#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.
#thor dm:gems:wipe #to clean out any old datamapper gems
#thor dm:clone #to pull down the github datamapper repositories
#cd dm
#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:

cd ~/sources
git clone git://github.com/sam/dm-more.git
cd dm-more/merb_datamapper
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:

cd ~/sources
git clone git://github.com/sam/do.git
cd do
rake install

|