<?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>cat /dev/braindump &#187; Ruby on Rails</title>
	<atom:link href="http://blog.ginkel.com/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.ginkel.com</link>
	<description>A Geek&#039;s Thoughts on Life, Arts, Software and Technology</description>
	<lastBuildDate>Sun, 04 Dec 2011 14:36:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Rails Scalability</title>
		<link>http://blog.ginkel.com/2010/10/rails-scalability/</link>
		<comments>http://blog.ginkel.com/2010/10/rails-scalability/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 15:19:53 +0000</pubDate>
		<dc:creator>Thilo-Alexander Ginkel</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[English]]></category>

		<guid isPermaLink="false">http://blog.ginkel.com/?p=785</guid>
		<description><![CDATA[Pretty interesting Google Tech Talk about scaling Rails apps or web apps in general:]]></description>
			<content:encoded><![CDATA[<p>Pretty interesting Google Tech Talk about scaling Rails apps or web apps in general:</p>
<p><object width="450" height="361"><param name="movie" value="http://www.youtube-nocookie.com/v/mRf4bpEtI6I?fs=1&amp;hl=en_US&amp;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/mRf4bpEtI6I?fs=1&amp;hl=en_US&amp;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="450" height="361"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ginkel.com/2010/10/rails-scalability/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails naming collisions</title>
		<link>http://blog.ginkel.com/2010/02/ruby-on-rails-naming-collisions/</link>
		<comments>http://blog.ginkel.com/2010/02/ruby-on-rails-naming-collisions/#comments</comments>
		<pubDate>Sat, 27 Feb 2010 20:34:55 +0000</pubDate>
		<dc:creator>Thilo-Alexander Ginkel</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[English]]></category>

		<guid isPermaLink="false">http://blog.ginkel.com/?p=549</guid>
		<description><![CDATA[Well, this post merely serves as a note to myself: Do not create an instance variable named @template in an ActionController or bad things will happen, such as this not very self-explanatory error: NoMethodError (undefined method `view_paths&#8217; for #&#60;EmailTemplate:0x7f751953fad0&#62;): /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service&#8217; /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run&#8217; /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread&#8217; /usr/lib/ruby/1.8/webrick/server.rb:162:in `start&#8217; /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread&#8217; /usr/lib/ruby/1.8/webrick/server.rb:95:in `start&#8217; /usr/lib/ruby/1.8/webrick/server.rb:92:in `each&#8217; /usr/lib/ruby/1.8/webrick/server.rb:92:in `start&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p>Well, this post merely serves as a note to myself:</p>
<p>Do not create an instance variable named <code>@template</code> in an <code>ActionController</code> or bad things will happen, such as this not very self-explanatory error:</p>
<blockquote><p>NoMethodError (undefined method `view_paths&#8217; for #&lt;EmailTemplate:0x7f751953fad0&gt;):<br />
  /usr/lib/ruby/1.8/webrick/httpserver.rb:104:in `service&#8217;<br />
  /usr/lib/ruby/1.8/webrick/httpserver.rb:65:in `run&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:173:in `start_thread&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:162:in `start_thread&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:95:in `start&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `each&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:92:in `start&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:23:in `start&#8217;<br />
  /usr/lib/ruby/1.8/webrick/server.rb:82:in `start&#8217;<br />
  /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_load&#8217;<br />
  /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/lib/ruby-debug.rb:101:in `debug_program&#8217;<br />
  /var/lib/gems/1.8/gems/ruby-debug-ide-0.4.5/bin/rdebug-ide:82<br />
  /var/lib/gems/1.8/bin/rdebug-ide:19:in `load&#8217;<br />
  /var/lib/gems/1.8/bin/rdebug-ide:19<br />
  -e:2:in `load&#8217;<br />
  -e:2
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.ginkel.com/2010/02/ruby-on-rails-naming-collisions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Das funktioniert doch alles nur zufällig&#8230;</title>
		<link>http://blog.ginkel.com/2010/02/das-funktioniert-doch-alles-nur-zufallig/</link>
		<comments>http://blog.ginkel.com/2010/02/das-funktioniert-doch-alles-nur-zufallig/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 20:12:41 +0000</pubDate>
		<dc:creator>Thilo-Alexander Ginkel</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech]]></category>

		<guid isPermaLink="false">http://blog.ginkel.com/?p=502</guid>
		<description><![CDATA[&#8230;ist einer der Gedanken, die einem bei einem Blick hinter die Kulissen so mancher Software in den Sinn kommen, wenn verschiedene Komponenten scheinbar mit heißer Nadel miteinander verbunden wurden und sich Bugs gegenseitig ausnivellieren. Während diese Feststellung bei den meisten Softwarepaketen eher zu einer Fluchtreaktion des Betrachters führt, ist es umso erstaunlicher, dass es klugen [...]]]></description>
			<content:encoded><![CDATA[<p>&#8230;ist einer der Gedanken, die einem bei einem Blick hinter die Kulissen so mancher Software in den Sinn kommen, wenn verschiedene Komponenten scheinbar mit heißer Nadel miteinander verbunden wurden und sich Bugs gegenseitig ausnivellieren.</p>
<p>Während diese Feststellung bei den meisten Softwarepaketen eher zu einer Fluchtreaktion des Betrachters führt, ist es umso erstaunlicher, dass es klugen Köpfen gelungen ist, das leichtfüßige Nebeneinander verschiedener Komponenten ohne strenge Bindung zum Paradigma zu erheben und darauf eine agile Softwareentwicklungsplattform aufzubauen. Das war die Geburtsstunde von Ruby on Rails.</p>
<p>Hiermit ist es möglich, umfangreiche Applikationen ohne das sonst häufig übliche Abhängigkeitswirrwarr zwischen den verschiedenen Komponenten zu bauen, das die Wartung ebendieser Applikationen sonst häufig zur Geduldsprobe werden lässt. Vielmehr verbinden sich Komponenten über Konventionen &#8211; ohne dass in den meisten Fällen eine direkte Abhängigkeit definiert werden muss.</p>
<p>Das ist dann in etwa so, als würde man einen Sack voller Lego-Steine ausschütten und wie durch Magie entsteht daraus ohne weiteres Zutun der <a href="http://shop.lego.com/product/?p=10188">Todesstern</a>. <img src='http://blog.ginkel.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>Mir gefällt&#8217;s jedenfalls&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.ginkel.com/2010/02/das-funktioniert-doch-alles-nur-zufallig/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ActionMailer and mod_fcgi</title>
		<link>http://blog.ginkel.com/2010/01/actionmailer-and-mod_fcgi/</link>
		<comments>http://blog.ginkel.com/2010/01/actionmailer-and-mod_fcgi/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 23:53:34 +0000</pubDate>
		<dc:creator>Thilo-Alexander Ginkel</dc:creator>
				<category><![CDATA[Hacking]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tech]]></category>
		<category><![CDATA[English]]></category>

		<guid isPermaLink="false">http://blog.ginkel.com/?p=484</guid>
		<description><![CDATA[Lately, I have been playing around a lot with Ruby on Rails and am currently finishing my first full-fledged application. While I am using WEBrick directly launched from my Eclipse development IDE in my development environment the production site is currently using Apache + mod_fcgi to run the application. This is where all the problems [...]]]></description>
			<content:encoded><![CDATA[<p>Lately, I have been playing around a lot with Ruby on Rails and am currently finishing my first full-fledged application. While I am using WEBrick directly launched from my Eclipse development IDE in my development environment the production site is currently using Apache + mod_fcgi to run the application. This is where all the problems started. <img src='http://blog.ginkel.com/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
<p>The application sends out e-mail notifications (using ActionMailer) for various state transitions, which worked flawlessly on the development machine. In the production setting, however, sending mails failed complaining that it cannot find the associated mail template:</p>
<blockquote><p><code>ActionView::MissingTemplate (Missing template event_mailer/approval_requested_notification.erb in view path app/views):<br />
  app/models/event_observer.rb:3:in `after_enter_awaiting_approval'<br />
  /usr/lib/ruby/1.8/observer.rb:185:in `notify_observers'<br />
  /usr/lib/ruby/1.8/observer.rb:184:in `each'<br />
  /usr/lib/ruby/1.8/observer.rb:184:in `notify_observers'<br />
  (eval):10:in `create_or_update_without_callbacks'<br />
  app/controllers/event_controller.rb:71:in `request_approval'<br />
  public/dispatch.fcgi:24<br />
</code></p></blockquote>
<p>Well, after putting some thought into possible differences between development and production and ruling out any relevant configuration differences in <code>config/*</code> all that remained was the fact that dev uses WEBrick while production uses mod_fcgi. One thought lead to another and it turned out that WEBrick sets the application root as the current working directory during startup while mod_fcgi does not.</p>
<p>So, the workaround is simple: Set the current working directory to the application root in config/environment.rb, such as:</p>
<blockquote><p><code>Dir.chdir(File.dirname(__FILE__) << '/../')</code></p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.ginkel.com/2010/01/actionmailer-and-mod_fcgi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

