<?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>JZ * LABS - the web experiment playground of jason ting &#187; Merb</title>
	<atom:link href="http://www.jzlabs.com/category/merb/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jzlabs.com</link>
	<description>the web experiment playground of jason ting</description>
	<lastBuildDate>Mon, 21 Nov 2011 04:15:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>:layout =&gt; false</title>
		<link>http://www.jzlabs.com/2008/11/27/layout-false/</link>
		<comments>http://www.jzlabs.com/2008/11/27/layout-false/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 23:51:09 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false">http://www.jzlabs.com/?p=83</guid>
		<description><![CDATA[I ran into a strange behavior when trying to use setInterval in JS to make an AJAX request every n seconds.  I had the timer in the $(document).ready(function() { } in the head of my application layout file.
There would be strange behavior with the timer--every interval would be twice as fast as the previous, and [...]]]></description>
			<content:encoded><![CDATA[<p>I ran into a strange behavior when trying to use setInterval in JS to make an AJAX request every n seconds.  I had the timer in the $(document).ready(function() { } in the head of my application layout file.</p>
<p>There would be strange behavior with the timer--every interval would be twice as fast as the previous, and the browser would quickly become unresponsive and crash.</p>
<p>I initially thought it was a Firefox bug so I wasted sometime googling setInterval but it turns out the AJAX request was rendering the view with the layout, thus creating another timer on each request.  Stupid.</p>
<p>Setting :layout =&gt; false on the offending action made everything play nice.  Moral of the story: don't forget to exclude your layouts for AJAX actions.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jzlabs.com/2008/11/27/layout-false/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Merb rake tasks</title>
		<link>http://www.jzlabs.com/2008/11/27/merb-rake-tasks/</link>
		<comments>http://www.jzlabs.com/2008/11/27/merb-rake-tasks/#comments</comments>
		<pubDate>Thu, 27 Nov 2008 23:00:16 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false">http://www.jzlabs.com/?p=70</guid>
		<description><![CDATA[When trying to run a merb rake task I wrote, I ran across this error:
rake aborted!
Don't know how to build task 'environment'
It turns out that merb uses a different environment variable than Rails,  so instead of :environment use :merb_env instead:
task :whatever =&#62; :merb_env do
]]></description>
			<content:encoded><![CDATA[<p>When trying to run a merb rake task I wrote, I ran across this error:</p>
<blockquote><p>rake aborted!<br />
Don't know how to build task 'environment'</p></blockquote>
<p>It turns out that merb uses a different environment variable than Rails,  so instead of :environment use :merb_env instead:</p>
<blockquote><p>task :whatever =&gt; :merb_env do</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jzlabs.com/2008/11/27/merb-rake-tasks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>merb and Twitter made easy with Twitter4R</title>
		<link>http://www.jzlabs.com/2008/11/26/merb-and-twitter-made-easy-with-twitter4r/</link>
		<comments>http://www.jzlabs.com/2008/11/26/merb-and-twitter-made-easy-with-twitter4r/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 23:34:12 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false">http://www.jzlabs.com/?p=77</guid>
		<description><![CDATA[Updating twitter with merb is super easy with Twitter4R:
sudo gem install twitter4r
in config/dependencies.rb:
gem "twitter4r"
require 'twitter'
(just doing dependency "twitter4r" didn't work)
in your controller:
client = Twitter::Client.new(:login =&#62; 'username', :password =&#62; 'password')
status = client.status(:post, "hello world")
]]></description>
			<content:encoded><![CDATA[<p>Updating twitter with merb is super easy with Twitter4R:</p>
<blockquote><p>sudo gem install twitter4r</p></blockquote>
<p>in config/dependencies.rb:</p>
<blockquote><p>gem "twitter4r"<br />
require 'twitter'</p></blockquote>
<p>(just doing dependency "twitter4r" didn't work)</p>
<p>in your controller:</p>
<blockquote><p>client = Twitter::Client.new(:login =&gt; 'username', :password =&gt; 'password')<br />
status = client.status(:post, "hello world")</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.jzlabs.com/2008/11/26/merb-and-twitter-made-easy-with-twitter4r/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strange errors when upgrading merb</title>
		<link>http://www.jzlabs.com/2008/11/26/strange-errors-when-upgrading-merb/</link>
		<comments>http://www.jzlabs.com/2008/11/26/strange-errors-when-upgrading-merb/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 23:31:32 +0000</pubDate>
		<dc:creator>Jason</dc:creator>
				<category><![CDATA[Merb]]></category>

		<guid isPermaLink="false">http://www.jzlabs.com/?p=75</guid>
		<description><![CDATA[I had some strange errors when upgrading to the latest version of merb (1.1.3).  When trying to run
rake db:automigrate
I would get something like:
~ Connecting to database...
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `initialize': wrong number of arguments (8 for 1) (ArgumentError)
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `normalize_uri'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/abstract_adapter.rb:44:in `initialize'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:159:in `initialize'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `new'
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `setup'
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:44:in `setup_connections'
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:27:in `connect'
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb_datamapper.rb:17:in `run'
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run'
from [...]]]></description>
			<content:encoded><![CDATA[<p>I had some strange errors when upgrading to the latest version of merb (1.1.3).  When trying to run</p>
<blockquote><p>rake db:automigrate</p></blockquote>
<p>I would get something like:</p>
<blockquote><p>~ Connecting to database...<br />
/opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `initialize': wrong number of arguments (8 for 1) (ArgumentError)<br />
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `new'<br />
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:137:in `normalize_uri'<br />
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/abstract_adapter.rb:44:in `initialize'<br />
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core/adapters/data_objects_adapter.rb:159:in `initialize'<br />
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `new'<br />
from /opt/local/lib/ruby/gems/1.8/gems/dm-core-0.9.6/lib/dm-core.rb:157:in `setup'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:44:in `setup_connections'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb/orms/data_mapper/connection.rb:27:in `connect'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb_datamapper-1.0/lib/merb_datamapper.rb:17:in `run'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:172:in `bootup'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:42:in `start'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core.rb:169:in `start'<br />
from /opt/local/lib/ruby/gems/1.8/gems/merb-core-1.0/bin/merb:11<br />
from /opt/local/bin/merb:19:in `load'<br />
from /opt/local/bin/merb:19</p></blockquote>
<p>After googling for awhile I found <a href="http://www.leonardoborges.com/writings/2008/11/18/merb-turns-10-and-started-driving-me-crazy/" target="_blank">this post </a> that suggested downgrading the addressable gem back to 1.0.4.  I tried doing that but stuff was still acting funky, it would say</p>
<blockquote><p>FATAL: The gem dm-core (= 0.9.7, runtime), [] was not found</p></blockquote>
<p>even though it was still there.  For some reason, doing sudo gem uninstall merb didn't clean up all the merb+other dependencies, so I had to start of clean by removing merb and all its dependencies:</p>
<blockquote><p>sudo gem uninstall addressable data_objects datamapper dm-aggregates dm-migrations dm-sweatshop dm-timestamps dm-types dm-validations do_mysql do_sqlite3 merb-action-args merb-assets merb-auth merb-auth-core merb-auth-more merb-auth-slice-password merb-cache merb-core merb-exceptions merb-gen merb-haml merb-helpers merb-mailer merb-more merb-param-protection merb-slices merb_datamapper</p></blockquote>
<p>After installing one more time, everything worked fine and dandy.  Sheesh, why can 'sudo gem update merb' play nice out of the box?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jzlabs.com/2008/11/26/strange-errors-when-upgrading-merb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

