<?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>LolocoJr &#187; rails</title>
	<atom:link href="http://www.railsguru.com/articles/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.railsguru.com</link>
	<description>Andy Lo-A-Foe&#039;s blog</description>
	<lastBuildDate>Fri, 09 Jul 2010 12:08:16 +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>has_many_polymorphs tagging snafu</title>
		<link>http://www.railsguru.com/articles/2008/01/17/has_many_polymorphs-tagging-snafu/</link>
		<comments>http://www.railsguru.com/articles/2008/01/17/has_many_polymorphs-tagging-snafu/#comments</comments>
		<pubDate>Thu, 17 Jan 2008 20:40:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[has_many_polymorphs]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[tagging]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2008/01/17/has_many_polymorphs-tagging-snafu</guid>
		<description><![CDATA[<p>I&#8217;m working on a Rails 2.0.x project which is a port of a 1.2.x based one. Since acts_as_taggable was obsoleted in 2.0.x I&#8217;m using the ultra wicked has_many_polymorphs plugin which comes with a neat Tagging generator. I ran in a bit of problem when I tried tagging an object with the tags &#8220;cool mac 2008&#8243;. [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m working on a Rails 2.0.x project which is a port of a 1.2.x based one. Since acts_as_taggable was obsoleted in 2.0.x I&#8217;m using the ultra wicked <strong>has_many_polymorphs</strong> plugin which comes with a neat Tagging generator. I ran in a bit of problem when I tried tagging an object with the tags &#8220;cool mac 2008&#8243;. It turned out the &#8220;2008&#8243; is the culprit since the tag_with method that&#8217;s introduced tries to be really smart about things. I.e. it assumes that if you pass a number in the tag_with string you actually want to use the Tag object with ID=2008. Of course we don&#8217;t have 2008 tags yet so it breaks down with an exception. The solution was really simple. Just remove the Fixnum check in the lib/lagging_extensions.rb ..</p>
<p>
P.S. Better late than never: <strong>Happy 2008!!!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2008/01/17/has_many_polymorphs-tagging-snafu/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby En Rails 2007 Conference</title>
		<link>http://www.railsguru.com/articles/2007/05/23/ruby-en-rails-2007-conference/</link>
		<comments>http://www.railsguru.com/articles/2007/05/23/ruby-en-rails-2007-conference/#comments</comments>
		<pubDate>Wed, 23 May 2007 08:00:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[mongrel]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[talks]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/07/14/ruby-en-rails-2007-conference</guid>
		<description><![CDATA[<p>On June 7th the Ruby En Rails 2007 Conference will be held here in Amsterdam. I&#8217;m really looking forward to meeting up with the dutch Rails crowd. I&#8217;ll be giving a lighting talk on Mongrel clustering and will share my experience with this in use on a busy site. Also looking forward to some of [...]]]></description>
			<content:encoded><![CDATA[<p>On June 7th the <a href="http://2007.rubyenrails.nl/">Ruby En Rails 2007 Conference</a> will be held here in Amsterdam. I&#8217;m really looking forward to meeting up with the dutch Rails crowd. I&#8217;ll be giving a lighting talk on <a href="http://2007.rubyenrails.nl/sprekers/tracks">Mongrel clustering</a> and will share my experience with this in use on a <a href="http://www.filmpjes.nl">busy</a> site. Also looking forward to some of the talks, especially the opening keynote. Hope to see you there!!</p>
<p>
<strong>Update:</strong> I just read there are no more seats left, so hope you got in!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2007/05/23/ruby-en-rails-2007-conference/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rewriting a (large) PHP application in Rails, part 2</title>
		<link>http://www.railsguru.com/articles/2006/12/19/rewriting-a-large-php-application-in-rails-part-2/</link>
		<comments>http://www.railsguru.com/articles/2006/12/19/rewriting-a-large-php-application-in-rails-part-2/#comments</comments>
		<pubDate>Tue, 19 Dec 2006 18:20:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/08/16/rewriting-a-large-php-application-in-rails-part-2</guid>
		<description><![CDATA[<p>In my previous post on this topic I described the method we used to convert
a legacy MySQL PHP database to a Rails conformant PostgreSQL hosted version. In this article I will tell a bit about how we converted the HTML of the application to Rails layout templates and partials.</p>
Extracting HTML from Firefox DOM
<p>We first started [...]]]></description>
			<content:encoded><![CDATA[<p>In my <a href="http://railsguru.com/articles/2006/12/13/rewriting-a-large-php-application-in-rails-part-1">previous post</a> on this topic I described the method we used to convert<br />
a legacy MySQL <span class="caps">PHP</span> database to a Rails conformant PostgreSQL hosted version. In this article I will tell a bit about how we converted the <span class="caps">HTML</span> of the application to Rails layout templates and partials.</p>
<h4>Extracting <span class="caps">HTML</span> from Firefox <span class="caps">DOM</span></h4>
<p>We first started out with attempting to rewrite the table heavy design to <span class="caps">CSS</span>. We soon realised that this was a project on itself so we decided to work with what we have. Since most of the <span class="caps">HTML</span> code is intermingled with <span class="caps">PHP</span> logic it was really not an option to examine the numerous .php files and cut &#8216;n paste what we needed.<br />
We basically used the excellent <a href="https://addons.mozilla.org/firefox/697/">Firefox View Formatted Source extension</a> to take snapshots of the <span class="caps">DOM</span> tree of rendered pages (<a href="http://mcuadros.es/2006/10/25/extension-view-formatted-source-en-firefox-20/">look here</a> if you&#8217;re on <span class="caps">FF2</span>).</p>
<p>
<img src="/assets/2007/4/16/vfs_popup.png" /></p>
<p> Getting the <span class="caps">HTML</span> from the Firefox <span class="caps">DOM</span> meant we had properly balanced <span class="caps">HTML</span>! The real work was to extract layout templates and to identify the partials. This turned out to relatively easy. The really hard part was to get the code to display properly in Internet Explorer, which unfortunately still makes up about 70% of all traffic to the site.</p>
<p>
<img src="/assets/2007/4/16/vfs_window.png" />
</p>
</p>
<h4>Writing down business logic</h4>
<p>The original project never had functional or technical specifications so I scheduled 3 sessions spread over 2 weeks with the (back-end) users of the system. We identified the business logic and rules of the system as best as we could during these (1-2 hour) sessions. The whole business logic was then written again from scratch in Ruby. I figured it would have take much longer if I had examined the <span class="caps">PHP</span> code myself. This might not be an option for you though. Anyway, during these 2 weeks at the end of each day a small number of functionalities would be delivered for testing. In practice the user(s) would only test functionality and provide feedback every 3-4 days (busy schedules on both sides, so noone enforced this). Could have been better.</p>
<h4><span class="caps">TDD</span>, or rather <span class="caps">WTAD</span> (Write Test After Developing)</h4>
<p>It was really really hard to bring up the discipline of writing the Test code before Developing the functionality. In practice tests were only written after something was seen working already. What do <strong>you</strong> do, honestly? <img src='http://www.railsguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>
The final part will contain details about the deployment (Mongrels, W00t!) and also some interesting statistics on how many lines were left after the rewrite. Stay tuned..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/12/19/rewriting-a-large-php-application-in-rails-part-2/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>XS4ALL Crazy Colo Night history</title>
		<link>http://www.railsguru.com/articles/2006/08/09/xs4all-crazy-colo-night-history/</link>
		<comments>http://www.railsguru.com/articles/2006/08/09/xs4all-crazy-colo-night-history/#comments</comments>
		<pubDate>Wed, 09 Aug 2006 15:16:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[colo]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[server]]></category>
		<category><![CDATA[xs4all]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/08/16/xs4all-crazy-colo-night-history</guid>
		<description><![CDATA[<p>At the last Crazy Colo Nights of XS4ALL we wrote a little history. It seems we were the first customer ever to bring their server for immediate placement!  </p>
<p>

</p>
<p>
That&#8217;s actually the first dedicated Rails server of my company!! We&#8217;ve already placed a second server there and we&#8217;re planning a full migration to XS4ALL in [...]]]></description>
			<content:encoded><![CDATA[<p>At the last <a href="http://www.xs4all.nl/nieuws/bericht.php?id=764&#38;taal=nl&#38;msect=Nieuws">Crazy Colo Nights</a> of <span class="caps">XS4ALL</span> we wrote a little history. It seems we were the first customer ever to bring their server for immediate placement! <img src='http://www.railsguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> <br/></p>
<p>
<img src="http://www.xs4all.nl/allediensten/images/ccn/IMGP1523.jpg" /><br/>
</p>
<p>
That&#8217;s actually the first dedicated <strong>Rails</strong> server of <a href="http://www.inbc-media.com">my company</a>!! We&#8217;ve already placed a second server there and we&#8217;re planning a full migration to <span class="caps">XS4ALL</span> in the near future. These guys know their stuff! <a href="http://www.xs4all.nl/allediensten/eigenserver/colocation/crazycolonight.php">Check  the other photo&#8217;s</a> of the colo nights.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/08/09/xs4all-crazy-colo-night-history/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Using MPlayer identify with Ruby</title>
		<link>http://www.railsguru.com/articles/2006/07/12/using-mplayer-identify-with-ruby/</link>
		<comments>http://www.railsguru.com/articles/2006/07/12/using-mplayer-identify-with-ruby/#comments</comments>
		<pubDate>Wed, 12 Jul 2006 12:13:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[mplayer]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/07/30/using-mplayer-identify-with-ruby</guid>
		<description><![CDATA[<p>For a project I need to fetch some metadata from WAV recordings. Mplayer can extract this information nicely with the -identify command. I&#8217;m using Ruby Sessions for executing the external mplayer command, although a simple IO.POpen() might do fine too. The code wrapper class looks like this:</p>



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25



require 'rubygems'
require_gem 'session'

class MediafileInfo
      [...]]]></description>
			<content:encoded><![CDATA[<p>For a project I need to fetch some metadata from <span class="caps">WAV</span> recordings. Mplayer can extract this information nicely with the -identify command. I&#8217;m using <a href="http://raa.ruby-lang.org/project/session/">Ruby Sessions</a> for executing the external mplayer command, although a simple IO.POpen() might do fine too. The code wrapper class looks like this:<br/></p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt>4<tt>
</tt>5<tt>
</tt>6<tt>
</tt>7<tt>
</tt>8<tt>
</tt>9<tt>
</tt><strong>10</strong><tt>
</tt>11<tt>
</tt>12<tt>
</tt>13<tt>
</tt>14<tt>
</tt>15<tt>
</tt>16<tt>
</tt>17<tt>
</tt>18<tt>
</tt>19<tt>
</tt><strong>20</strong><tt>
</tt>21<tt>
</tt>22<tt>
</tt>23<tt>
</tt>24<tt>
</tt>25<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">require <span class="s"><span class="dl">'</span><span class="k">rubygems</span><span class="dl">'</span></span><tt>
</tt>require_gem <span class="s"><span class="dl">'</span><span class="k">session</span><span class="dl">'</span></span><tt>
</tt><tt>
</tt><span class="r">class</span> <span class="cl">MediafileInfo</span><tt>
</tt>        <span class="co">MPLAYER_BINARY</span> = <span class="s"><span class="dl">&quot;</span><span class="k">mplayer</span><span class="dl">&quot;</span></span><tt>
</tt>        <span class="co">MPLAYER_IDENTIFY</span> = <span class="s"><span class="dl">&quot;</span><span class="k">-identify -vo null -ao null -frames 0</span><span class="dl">&quot;</span></span><tt>
</tt><tt>
</tt>        <span class="r">def</span> <span class="fu">initialize</span>(filename)<tt>
</tt>                stdout, stderr = <span class="s"><span class="dl">'</span><span class="dl">'</span></span>, <span class="s"><span class="dl">'</span><span class="dl">'</span></span><tt>
</tt>                shell = <span class="co">Session</span>::<span class="co">Shell</span>.new<tt>
</tt>                shell.execute <span class="s"><span class="dl">&quot;</span><span class="il"><span class="dl">#{</span><span class="co">MPLAYER_BINARY</span><span class="dl">}</span></span><span class="k"> </span><span class="il"><span class="dl">#{</span><span class="co">MPLAYER_IDENTIFY</span><span class="dl">}</span></span><span class="k"> </span><span class="il"><span class="dl">#{</span>filename<span class="dl">}</span></span><span class="dl">&quot;</span></span>, <span class="sy">:stdout</span> =&gt; stdout, <span class="sy">:stderr</span> =&gt; stderr<tt>
</tt><tt>
</tt>                vars = (stdout.split(<span class="rx"><span class="dl">/</span><span class="ch">\n</span><span class="dl">/</span></span>).collect! { |o| o <span class="r">if</span> o =~ <span class="rx"><span class="dl">/</span><span class="k">^ID_</span><span class="dl">/</span></span> } ).compact!<tt>
</tt><tt>
</tt>                vars.each { |v|<tt>
</tt>                        a, b = v.split(<span class="s"><span class="dl">&quot;</span><span class="k">=</span><span class="dl">&quot;</span></span>)<tt>
</tt>                        eval <span class="s"><span class="dl">&quot;</span><span class="k">@</span><span class="il"><span class="dl">#{</span>a.to_s.downcase<span class="dl">}</span></span><span class="k"> = </span><span class="ch">\&quot;</span><span class="il"><span class="dl">#{</span>b<span class="dl">}</span></span><span class="ch">\&quot;</span><span class="dl">&quot;</span></span><tt>
</tt>                }<tt>
</tt>        <span class="r">end</span><tt>
</tt><tt>
</tt>        <span class="c"># Intercept calls</span><tt>
</tt>        <span class="r">def</span> <span class="fu">method_missing</span>(method_name, *args)<tt>
</tt>                value = eval <span class="s"><span class="dl">&quot;</span><span class="k">@id_</span><span class="il"><span class="dl">#{</span>method_name.to_s.downcase<span class="dl">}</span></span><span class="dl">&quot;</span></span><tt>
</tt>        <span class="r">end</span><tt>
</tt><span class="r">end</span></pre>
</td>
</tr>
</table>
<p><br/><br />
All ID_* lines that mplayer spits out will now be method calls (and instance variables) of your MediafileInfo object. The method_missing call is there to do proper value defaulting if the variable doesn&#8217;t exist, but I&#8217;m not using it as such right now. To get the playing time of every type of mediafile that mplayer understands you simply do someting like:</p>
<table class="CodeRay">
<tr>
<td class="line_numbers" title="click to toggle" onclick="with (this.firstChild.style) { display = (display == '') ? 'none' : '' }">
<pre>1<tt>
</tt>2<tt>
</tt>3<tt>
</tt></pre>
</td>
<td class="code">
<pre ondblclick="with (this.style) { overflow = (overflow == 'auto' || overflow == '') ? 'visible' : 'auto' }">info = <span class="co">MediafileInfo</span>.new(<span class="s"><span class="dl">&quot;</span><span class="k">voicemail.wav</span><span class="dl">&quot;</span></span>)<tt>
</tt><tt>
</tt>puts <span class="s"><span class="dl">&quot;</span><span class="k">Voicemail playtime: </span><span class="il"><span class="dl">#{</span>info.length.to_i<span class="dl">}</span></span><span class="k"> seconds</span><span class="dl">&quot;</span></span></pre>
</td>
</tr>
</table>
<p>Ruby 0wnz! <img src='http://www.railsguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br/><br />
<br/></p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/07/12/using-mplayer-identify-with-ruby/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Rails Show and Tell</title>
		<link>http://www.railsguru.com/articles/2006/06/24/rails-show-and-tell/</link>
		<comments>http://www.railsguru.com/articles/2006/06/24/rails-show-and-tell/#comments</comments>
		<pubDate>Sat, 24 Jun 2006 13:27:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/10/05/rails-show-and-tell</guid>
		<description><![CDATA[<p>Gave a small presentation at the Rails Show And Tell meeting. I covered Web services with Rails. Actually it was more a of an introduction to Web Services, it was a lightning talk anyway   The Rails online manuals has a nice chapter on Web Services. This article also shows what you can expect [...]]]></description>
			<content:encoded><![CDATA[<p>Gave a small presentation at the <a href="http://www.fngtps.com/2006/05/rails-show-and-tell-meeting">Rails Show And Tell</a> meeting. I covered Web services with Rails. Actually it was more a of an introduction to Web Services, it was a lightning talk anyway <img src='http://www.railsguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  The Rails online manuals has a <a href="http://manuals.rubyonrails.com/read/book/10">nice chapter on Web Services</a>. <a href="http://wiki.rubyonrails.org/rails/pages/How+To+Consume+.NET+WebServices">This article</a> also shows what you can expect when doing cross language WS.<br/><br />
<br/><br />
The rest of my talk was about a number of production applications we are doing on Rails. I talked a bit about <a href="http://beldienst.nl">Beldienst.nl</a> and <span class="caps">RADNS</span> (Intranet only). You can <a href="/files/Rails_WS_SAT.pdf">download the slides</a>. The guys from <a href="http://www.fngtps.com">Fingertips</a> made audio recordings which should hopefully show up somewhere next week.<br/><br />
Overall I&#8217;d say the event was a big success, lots of cool talks, and of course interesting chatter with fellow Rails enthousiasts. Thanks to IT from <a href-"http://www.greenpeace.org">Greenpeace</a> for letting us use their basement <img src='http://www.railsguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> <br/><br />
<br/><br />
<b>Update:</b> Thijs has now made available the <a href="http://www.fngtps.com/2006/06/rails-show-and-tell-talks">audio feeds</a> with slides.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/06/24/rails-show-and-tell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails&#8217; end_of_month</title>
		<link>http://www.railsguru.com/articles/2006/02/20/rails-end_of_month/</link>
		<comments>http://www.railsguru.com/articles/2006/02/20/rails-end_of_month/#comments</comments>
		<pubDate>Mon, 20 Feb 2006 00:30:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/05/31/rails-end_of_month</guid>
		<description><![CDATA[<p>Whilst building the payment module for one of my Rails apps I used the very convenient  Rails&#8217; Time extension method end_of_month  returns the last day of the month. However it sets the time to 00:00:00, which is quite unexpected IMHO! Technically the end of the month is still 86400 seconds away. This behaviour [...]]]></description>
			<content:encoded><![CDATA[<p>Whilst building the payment module for one of my Rails apps I used the very convenient  Rails&#8217; Time extension method <a href="http://api.rubyonrails.org/classes/ActiveSupport/CoreExtensions/Time/Calculations.html#M000221">end_of_month</a>  returns the last day of the month. However it sets the time to 00:00:00, which is quite unexpected <span class="caps">IMHO</span>! Technically the end of the month is still 86400 seconds away. This behaviour is documented, but if you haven&#8217;t actually read the whole <span class="caps">API</span> it might cause some nasty surprises. I fixed it by simply adding 86399 seconds to end_of_time. That still leaves 999 usecs, but I can live with that <img src='http://www.railsguru.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/02/20/rails-end_of_month/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Typo on Lighttpd</title>
		<link>http://www.railsguru.com/articles/2006/01/15/typo-on-lighttpd/</link>
		<comments>http://www.railsguru.com/articles/2006/01/15/typo-on-lighttpd/#comments</comments>
		<pubDate>Sun, 15 Jan 2006 21:28:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/11/05/typo-on-lighttpd</guid>
		<description><![CDATA[<p>This blog has been running on lighttpd since last week. So far it seems to be the best setup for running Rails app. Of course everyone in the Rails world alread knew this but breaking the Apache habit after 8 years is quite hard. However, I&#8217;m convinced now that Rails on top of lighttpd + [...]]]></description>
			<content:encoded><![CDATA[<p>This blog has been running on lighttpd since last week. So far it seems to be the best setup for running Rails app. Of course everyone in the Rails world alread knew this but breaking the Apache habit after 8 years is quite hard. However, I&#8217;m convinced now that Rails on top of lighttpd + fastcgi is, at least for me, currently the best deployment stack for production use. I&#8217;ve already switched one of our internal Rails app to the same app. Currently testing, the soon to be deployed, commercial project and it&#8217;s been smooth sailing so far! Perhaps it&#8217;s time to try <a href="/articles/2005/12/27/typo-on-scgi"><span class="caps">SCGI</span></a> again.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/01/15/typo-on-lighttpd/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Apache2 + SRR  = Crash and Burn?</title>
		<link>http://www.railsguru.com/articles/2006/01/09/apache2-srr-crash-and-burn/</link>
		<comments>http://www.railsguru.com/articles/2006/01/09/apache2-srr-crash-and-burn/#comments</comments>
		<pubDate>Mon, 09 Jan 2006 22:39:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[lighttpd]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[typo]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2008/10/20/apache2-srr-crash-and-burn</guid>
		<description><![CDATA[<p>Well, it turns out Apache2 + SCGI is not a good match, at least not the way I set it up, by following all the (scarce!) documentation on the subject. I used the SCGI Rails Runner package for running. The benefits of having better control of the Rails processes and the supposed easy clustering setup [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it turns out Apache2 + <span class="caps">SCGI</span> is not a good match, at least not the way I set it up, by following all the (scarce!) documentation on the subject. I used the <a href="http://www.zedshaw.com/projects/scgi_rails/index.html"><span class="caps">SCGI</span> Rails Runner</a> package for running. The benefits of having better control of the Rails processes and the supposed easy clustering setup sounded quite appealing. However I hit a brick wall quite quickly. While attempting some load tests on a new Rails that is going into production somewhere this month I noticed the scgi process hung reliably after only 3 concurrent requests! The only thing I could find in the logs were this:<br/></p>
<pre>
Errno::ECONNRESET (Connection reset by peer)
</pre>
<p>After the above error is thrown the connection between Apache2 and scgi is lost and your Rails app is dead in the water (Apache 2.0.54, mod_scgi 1.0, <span class="caps">SRR 0</span>.4.3, Rails 1.0, Ruby 1.8.3). Perhaps Ruby 1.8.3 is to blame? I hope Breezy upgrades to 1.8.4 (not likely), Dapper is still a nono, so probably have to self-compile Ruby. Will try this over the weekend. In the meantime I&#8217;m testing lighttpd + fastCGI and so far: <span class="caps">WOAW</span>!! More on this later..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2006/01/09/apache2-srr-crash-and-burn/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActiveRecord InvalidStatement</title>
		<link>http://www.railsguru.com/articles/2005/12/07/activerecord-invalidstatement/</link>
		<comments>http://www.railsguru.com/articles/2005/12/07/activerecord-invalidstatement/#comments</comments>
		<pubDate>Wed, 07 Dec 2005 17:10:00 +0000</pubDate>
		<dc:creator>andy</dc:creator>
				<category><![CDATA[Home]]></category>
		<category><![CDATA[activerecord]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://www.railsguru.com/2007/04/13/activerecord-invalidstatement</guid>
		<description><![CDATA[<p>It seems that ActiveRecord cannot return sane errors when some constraint on a database operation is not met, for instance if you forget to set an attribute which has a &#8220;NOT NULL&#8221; constraint. If this happens AR simply throws an InvalidStatement exception. You would have to actually search your database logs for the error message. [...]]]></description>
			<content:encoded><![CDATA[<p>It seems that ActiveRecord cannot return sane errors when some constraint on a database operation is not met, for instance if you forget to set an attribute which has a &#8220;NOT <span class="caps">NULL</span>&#8221; constraint. If this happens AR simply throws an InvalidStatement exception. You would have to actually search your database logs for the error message. This really sucks! Also check out <a href="http://substantiality.net/articles/2005/11/10/activerecord-has-got-issues">this blog post on the same topic</a>. Oh well, perhaps I should try and fix this issue instead of griping, it&#8217;s open source after all. You can of course also argue that the model file in the Rails app was not complete (:allow_nil =&gt; false)..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.railsguru.com/articles/2005/12/07/activerecord-invalidstatement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
