<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Slash Dot Dash &#187; Merb</title>
	<atom:link href="http://www.slashdotdash.net/category/merb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.slashdotdash.net</link>
	<description>Rolling on Rails</description>
	<lastBuildDate>Wed, 18 Mar 2009 22:03:19 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Easy Merb installation using Thor</title>
		<link>http://www.slashdotdash.net/2008/09/20/easy-merb-installation-using-thor/</link>
		<comments>http://www.slashdotdash.net/2008/09/20/easy-merb-installation-using-thor/#comments</comments>
		<pubDate>Sat, 20 Sep 2008 00:42:00 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[There&#8217;s now a much simpler way to get Merb setup than I previously noted. By using Thor, either the Stable (Gem) or Edge releases of Merb can be installed as a local Ruby Gem or bundled with your Merb app. The thor tasks are context aware. Run them in a Merb application directory and they&#8217;ll [...]]]></description>
			<content:encoded><![CDATA[<p>There&#8217;s now a much simpler way to get Merb setup than I <a href="http://www.slashdotdash.net/articles/2008/07/05/getting-started-with-merb-and-datamapper">previously noted</a>. By using <a href="http://yehudakatz.com/2008/05/12/by-thors-hammer/">Thor</a>, either the Stable (Gem) or Edge releases of Merb can be installed as a local Ruby Gem or bundled with your Merb app.</p>
<p>The <code>thor</code> tasks are <em>context aware</em>. Run them in a Merb application directory and they&#8217;ll bundle the relevant files with your app; keeping dependencies with the application and making it independent of your system’s Ruby Gems. When run outside any application, they target the system in general (installing as a standard Gem). This is determined by the presence of a local <code>gems</code> directory (or by specifying the <code>--merb-root</code> option).</p>
<h2>Installing Edge Merb and DataMapper</h2>
<pre><code>mkdir merb; cd merb

# Install Thor
sudo gem install thor

# Get merb.thor file (or update existing file)
curl -L http://merbivore.com/merb.thor &gt; merb.thor
thor merb:tasks:update

# Merb (edge)
sudo thor merb:edge:core --install
sudo thor merb:edge:more --install
sudo thor merb:edge:plugins --install

# DataMapper
sudo thor merb:edge:dm_core --install
sudo thor merb:edge:dm_more --install</code></pre>
<p>Keeping updated with the latest Merb (<code>merb-core</code> and <code>merb-more</code> only) is now simply:</p>
<pre><code>sudo thor merb:edge --install</code></pre>
<p>Further details are given on the <a href="http://merbunity.com/tutorials/18">merbunity site</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdotdash.net/2008/09/20/easy-merb-installation-using-thor/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Getting started with Merb and Datamapper</title>
		<link>http://www.slashdotdash.net/2008/07/05/getting-started-with-merb-and-datamapper/</link>
		<comments>http://www.slashdotdash.net/2008/07/05/getting-started-with-merb-and-datamapper/#comments</comments>
		<pubDate>Sat, 05 Jul 2008 23:46:00 +0000</pubDate>
		<dc:creator>Ben</dc:creator>
				<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Merb is the up-and-coming Ruby web framework, designed to improve upon the ideas in Rails whilst being faster, lighter and less opinionated (or more agnostic). I wanted to discover whether it provides any benefits over Rails and what it does differently. The best way to find out; get it installed it and create a new [...]]]></description>
			<content:encoded><![CDATA[<p>Merb is the up-and-coming Ruby web framework, designed to improve upon the ideas in Rails whilst being faster, lighter and less opinionated (or more agnostic). I wanted to discover whether it provides any benefits over Rails and what it does differently. The best way to find out; get it installed it and create a new app.</p>
<p><strong>Update</strong>: There&#8217;s now a <a href="http://www.slashdotdash.net/articles/2008/09/20/easy-merb-installation-using-thor">much easier way of getting Merb &#38; DataMapper installed</a>.</p>
<p>The <a href="http://www.merbivore.com/">official Merb website</a> gives the following simple installation instructions.</p>
<pre><code>sudo gem install merb</code></pre>
<p>However, since I wanted to also try DataMapper as the <span class="caps">ORM</span> those instructions failed to install a working setup due to a <a href="http://wm.lighthouseapp.com/projects/4819/tickets/440-merb_datamapper-is-out-of-date-version-mismatch-with-dm-more">conflict between Merb and DataMapper dependencies</a>. Unperturbed, I finally got them both installed and working happily together by getting the bleeding edge code from each project&#8217;s github repository and following the instructions provided by Mathew Ford&#8217;s <a href="http://4ninjas.org/merb/">Living life on the edge</a>. The book is also available on <a href="http://github.com/deimos1986/book_mdar/tree/master">github</a>, you can contribute patches there. Hopefully this issue will be resolved soon enough so that you&#8217;ll be able to install the official release gems for both Merb and DataMapper from Rubyforge (instead of running on edge).</p>
<h3>Prerequisites</h3>
<ul>
<li>You must have git installed (<code>sudo port install git-core</code> using MacPorts on <span class="caps">OS X</span>).</li>
<li>Remove any older versions of merb (and datamapper) that you might have installed. Use <code>gem list</code> to view local gems and <code>sudo gem uninstall &lt;name&gt;</code> to remove each individual gem.</li>
</ul>
<h2>The Easy Way</h2>
<p>Matt&#8217;s book outlines an <em>easy way</em> of installing the latest merb &#38; datamapper source, however it failed to properly install the DataMapper gem for me so I had to resort to the <em>hardcore</em> approach.</p>
<pre><code>sudo gem install sake
sake -i 'http://edgy.4ninjas.org/edgy.sake'
sake edgy:install packages="merb-stack"</code></pre>
<p>After installing, to keep up-to-date you just need to execute:</p>
<pre><code>sake edgy:update</code></pre>
<p>Now, if you&#8217;re hardcore&#8230;</p>
<h3>Installing the required dependencies</h3>
<p>Start by installing the gem dependancies.</p>
<pre><code>sudo gem install rack mongrel json erubis mime-types rspec hpricot mocha rubigen haml markaby mailfactory ruby2ruby</code></pre>
<h2>Installing Merb</h2>
<p>Download the merb source:</p>
<pre><code>git clone git://github.com/wycats/merb-core.git
git clone git://github.com/wycats/merb-plugins.git
git clone git://github.com/wycats/merb-more.git</pre>
<p></code></p>
<p>Then install the gems via rake:</p>
<pre><code>cd merb-core ; rake install ; cd ..
cd merb-more ; rake install ; cd ..
cd merb-plugins; rake install ; cd ..</pre>
<p></code></p>
<h2>Installing DataMapper</h2>
<pre><code>git clone git://github.com/sam/extlib.git
git clone git://github.com/sam/do.git

cd extlib ; rake install ; cd ..
cd do
cd data_objects ; rake install ; cd ..
cd do_mysql ; rake install ; cd ..
cd ..

git clone git://github.com/sam/dm-core.git
git clone git://github.com/sam/dm-more.git

cd dm-core ; rake install ; cd ..
cd dm-more ; rake install ; cd ..</pre>
<p></code></p>
<h3>Keeping updated</h3>
<p>To update your local gems with the latest code changes you&#8217;ll need to do a <code>git pull</code> and then <code>rake install</code> for each of the git repositories previously downloaded.</p>
<h2>Creating your first Merb app</h2>
<p>You create a new empty Merb app via the <code>merb-gen</code> utility.</p>
<pre><code>merb-gen app demo</pre>
<p></code></p>
<p>(You can also create flattened or single file applications if you wish).</p>
<pre><code>merb-gen app app_name --flat      (for a flattened application)
merb-gen app app_name --very-flat (for a single file application)</code></pre>
<p>As we&#8217;re using DataMapper we need to edit <code>config/init.rb</code> and uncomment the <code>use_orm :datamapper</code> line. The next step is to create the database settings file <code>config/database.yml</code>:</p>
<pre><code>---
development: &#38;defaults
  adapter:    mysql
  database:   demo_development
  username:   demo
  password:        p@ssword
  host:       localhost

test:
  &lt;&lt;:         *defaults
  database:   demo_test

production:
  &lt;&lt;:         *defaults
  database:   demo_production</code></pre>
<p>You can now fire up the Merb server to make sure it runs.</p>
<pre><code>$ merb
 ~ Loaded DEVELOPMENT Environment...
 ~ Connecting to database...
 ~ loading gem 'merb_datamapper' ...
 ~ Compiling routes...
 ~ Using 'share-nothing' cookie sessions (4kb limit per client)
 ~ Using Mongrel adapter</code></pre>
<p>Some other useful commands to know:</p>
<pre><code>merb -i                                                        # Interactive merb console

merb-gen model &lt;name&gt;                            # Creates a Datamapper Model stub
merb-gen resource &lt;name&gt;                    # Creates a full resource (incuding model, controller, views &#38; test spec)

rake dm:db:automigrate            # Perform automigration
rake dm:db:autoupgrade            # Perform non destructive automigration</code></pre>
<p>Let&#8217;s see how it goes from here with Merb!</p>
<p><strong>Update</strong>: There&#8217;s now a <a href="http://www.slashdotdash.net/articles/2008/09/20/easy-merb-installation-using-thor">much easier way of getting Merb &#38; DataMapper installed</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.slashdotdash.net/2008/07/05/getting-started-with-merb-and-datamapper/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
