<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Chee's blog &#187; Rails</title>
	<atom:link href="http://cheeyeo.wordpress.com/category/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://cheeyeo.wordpress.com</link>
	<description>Observations, tips, tricks, articles on Ruby and anything else that follows.</description>
	<lastBuildDate>Wed, 18 Mar 2009 00:19:55 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='cheeyeo.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/1c59aee0b01111d834f3bfb3e82f9b0d?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Chee's blog &#187; Rails</title>
		<link>http://cheeyeo.wordpress.com</link>
	</image>
			<item>
		<title>FIX RVIDEO 0.9.4 &#8216;NIL&#8217; BUG</title>
		<link>http://cheeyeo.wordpress.com/2009/03/18/fix-rvideo-094-nil-bug/</link>
		<comments>http://cheeyeo.wordpress.com/2009/03/18/fix-rvideo-094-nil-bug/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 00:19:55 +0000</pubDate>
		<dc:creator>cheeyeo</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[ffmpeg]]></category>
		<category><![CDATA[rvideo]]></category>

		<guid isPermaLink="false">http://cheeyeo.wordpress.com/?p=61</guid>
		<description><![CDATA[RVideo bug on latest version of ffmpeg<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=61&subd=cheeyeo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I use RVideo gem a lot for a video processing application I have been building in Rails which will be open sourced soon on github. Using the gem you can create a RVideo::Inspector object to gather information about the uploaded file including its fps and content type.</p>
<p>If you use the latest version of ffmpeg (mine is SVN-r16905), I find that I keep getting nil values whenever I run the inspector objects. I googled around and found that this is due to a regular expression mismatch in the source. Change line 53 in inspector.rb in the source to:</p>
<pre>metadata = /(Input \#.*)\n(Must|At\sleast)/m.match(@raw_response)
</pre>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cheeyeo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cheeyeo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cheeyeo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cheeyeo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cheeyeo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cheeyeo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cheeyeo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cheeyeo.wordpress.com/61/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cheeyeo.wordpress.com/61/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cheeyeo.wordpress.com/61/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=61&subd=cheeyeo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cheeyeo.wordpress.com/2009/03/18/fix-rvideo-094-nil-bug/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cheeyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>New Rails app launched &#8211; MountView</title>
		<link>http://cheeyeo.wordpress.com/2009/02/19/new-rails-app-launched-mountview/</link>
		<comments>http://cheeyeo.wordpress.com/2009/02/19/new-rails-app-launched-mountview/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 22:40:57 +0000</pubDate>
		<dc:creator>cheeyeo</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[commercial]]></category>
		<category><![CDATA[mountview]]></category>

		<guid isPermaLink="false">http://cheeyeo.wordpress.com/?p=49</guid>
		<description><![CDATA[First commercial Rails application<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=49&subd=cheeyeo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>MountView, a questionnaire dispatch and monitoring system of which I am a co-developer has been launched. You can find more information here:</p>
<p><strong><cite>www.mountviewapp.com</cite></strong></p>
<p>This is my second commercial Rails application which is still under heavy development.</p>
<p>The first commercial Rails application which is an implementation of MountView is for EssexKarting. Screenshots and more description coming soon.</p>
<p>P/S EssexKARTING is a bespoke application so sorry can&#8217;t provide logins</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cheeyeo.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cheeyeo.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cheeyeo.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cheeyeo.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cheeyeo.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cheeyeo.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cheeyeo.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cheeyeo.wordpress.com/49/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cheeyeo.wordpress.com/49/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cheeyeo.wordpress.com/49/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=49&subd=cheeyeo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cheeyeo.wordpress.com/2009/02/19/new-rails-app-launched-mountview/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cheeyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Fixing attachment_fu undefined method error</title>
		<link>http://cheeyeo.wordpress.com/2009/02/19/fixing-attachment_fu-undefined-method-error/</link>
		<comments>http://cheeyeo.wordpress.com/2009/02/19/fixing-attachment_fu-undefined-method-error/#comments</comments>
		<pubDate>Thu, 19 Feb 2009 22:36:24 +0000</pubDate>
		<dc:creator>cheeyeo</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[Ruby]]></category>
		<category><![CDATA[plugins]]></category>
		<category><![CDATA[attachment_fu]]></category>
		<category><![CDATA[error]]></category>

		<guid isPermaLink="false">http://cheeyeo.wordpress.com/?p=47</guid>
		<description><![CDATA[How to fix undefined method error with using the attachment_fu plugin on Ruby 1.8.7<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=47&subd=cheeyeo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Hello there. First of all apologies for not posting for a while. I have been busy working on commercial Rails projects for the very first time and as such, that takes precedence. However, I am also aware of the need to keep blogging and keep up the practise more as a note to myself about the things I have encountered through work and also to show potential exmployers that I KNOW WHAT I AM TALKING ABOUT.</p>
<p>To start off 2009, I would like to highlight an interesting error I came across today with regards to using attachment_fu plugin. It is a great plugin for handling file uploads in Rails and there are plenty of resources on the web to get you started. The issue arose when I fired up an old Rails application running on 2.0.2 with a view that uses attachment_fu for uplaods. The following error appears on the console:</p>
<p><strong>NoMethodError in XXXController<br />
</strong></p>
<p><strong>undefined method `[]&#8216; for #&lt;Enumerable::Enumerator&#8230;&#8230;..&gt; </strong></p>
<p>So I upgraded to Rails 2.1 and 2.2 but the error still persisted. It transpired that it is a conflict with the verion of Ruby you have running on your system (I use a MAC running on Ruby 1.8.7.) &#8211; it appears to be an issue with Ruby 1.8.7 &#8217;s string methods mdofications.</p>
<p>To fix it simply navigate to vendor/plugins/attachment_fu/lib/technoweenie/attachment_fu.rb and change the following line:</p>
<p><strong><br />
</strong></p>
<p><strong>attachment_options[:path_prefix]   = attachment_options[:path_prefix]<br />
[1..-1] if options[:path_prefix].starts_with?(&#8216;/&#8217;) </strong></p>
<p>Note that starts_with? is a String method only in 1.8.7. Save an relaunch yor application and all should be well.</p>
<p>I obtained the above from the following google group link:</p>
<p>http://groups.google.com/group/attachment_fu/browse_thread/thread/502dd4504a59c84d</p>
<p>Hope this helps someone &#8211; certainly helps me after hours of debugging!</p>
<p>P/S if the above has changed since then please let me know as I may not be the most up to date.</p>
  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cheeyeo.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cheeyeo.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cheeyeo.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cheeyeo.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cheeyeo.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cheeyeo.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cheeyeo.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cheeyeo.wordpress.com/47/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cheeyeo.wordpress.com/47/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cheeyeo.wordpress.com/47/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=47&subd=cheeyeo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cheeyeo.wordpress.com/2009/02/19/fixing-attachment_fu-undefined-method-error/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cheeyeo</media:title>
		</media:content>
	</item>
		<item>
		<title>Deploying Rails Part 1</title>
		<link>http://cheeyeo.wordpress.com/2008/08/31/deploying-rails-part-1/</link>
		<comments>http://cheeyeo.wordpress.com/2008/08/31/deploying-rails-part-1/#comments</comments>
		<pubDate>Sun, 31 Aug 2008 13:00:31 +0000</pubDate>
		<dc:creator>cheeyeo</dc:creator>
				<category><![CDATA[Rails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[deploy]]></category>
		<category><![CDATA[server]]></category>

		<guid isPermaLink="false">http://cheeyeo.wordpress.com/?p=26</guid>
		<description><![CDATA[Setting up NGINX on OS X Leopard Part 1<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=26&subd=cheeyeo&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>It is true that producing a rails application is half the batttle won- there are plenty of resources online and in books to guide a newbie through the process. Deploying a complete rails application is another challenge altogether. It requires a well-thought out plan and having the guts to deal with obscure error messages and grappling with the innards of server OS to get it right. It is an art in itself but it can be mastered by anyone with some patience and willingness to learn to get it right.</p>
<p>The traditional reply which I will provide anyone when ask how to deploy a rails application is to use Apache server as a shared host. However, I have recently discovered there are several disadvantages with this approach:</p>
<ol>
<li>Apache server requires mod_proxy module in order to run a cluster of mongrel servers. This means a default installation with the module already compiled or having to rebuild the entire server. Most shared host providers will not (in my experience) be willing to do that.</li>
<li>Any changes made to the configuration file require starting and restarting the server which means downtime for your application.</li>
<li>The configuration file (httpd.conf) is confusing &#8211; it relies on tags which in my experience is daunting and more error prone than a natural language syntax as in Ruby.</li>
</ol>
<p>Nginx, is an alternative to Apache and is capable of serving both static(html,css,javascript) request as well as dynamic request by routing it through to a mongrel cluster in the backend. It provides a host of configuration features including fcgi support as well as being able to make those configurations on the fly without having to restart the server! Yes, it means being able to upgrage the entire binary while your application still runs in the background.</p>
<p>Now I have not run any benchmark tests as of this writing but will do in subsequent post as to the speed it handles request but as it stands, a lot of major host providers(Engine Yard) and even some application providers(37signals,wordpress) are using it and commenting on significant improvements on performance.</p>
<p>I have setup nginx as a development server on my macbook and from what I understand by reading the wiki, there are two main approaches to installing it on osx.</p>
<ol>
<li>Using macports<br />
(<strong>sudo port install nginx)</strong></li>
<li>Downloading the latest stable tarball , extract and compile it.</li>
</ol>
<p>I tried both approaches and only the first seems to work for me. I will document in a subsequent post as to the result of the second approach.</p>
<p>It would be wise to stop apache server on your localhost if you have it setup previously before installing nginx.</p>
<p>Macports automatically installs nginx executable  into &#8216;/opt/local/sbin/nginx&#8217;. The configuration file is located at &#8216;/opt/local/etc/nginx/nginx.conf.default&#8217; &#8211; you need to copy and rename this file to &#8216;nginx.conf&#8217; before the server will start else you will get an error message on the terminal saying the conf file is not found.</p>
<p>To start or restart nginx I use the following commands on terminal:</p>
<p><strong>sudo launchctl start org.macports.nginx (to start it)</strong></p>
<p><strong>sudo launchctl start org.macports.nginx (to stop it)</strong></p>
<p>Fire up your browser and type in &#8216;http://localhost/&#8217; and you should see the following screen appear:<br />
<a href="http://cheeyeo.files.wordpress.com/2008/08/nginx.png"><br />
<img src="http://cheeyeo.files.wordpress.com/2008/08/nginx.png?w=568&#038;h=215" alt="" width="568" height="215" /></a></p>
<p>The default configuration points to &#8216;/opt/local/share/nginx/html/&#8217; but can be changed.</p>
<p>In part 2, I will showcase a configuration for a localhost deployment of a rails application including configuring your own mongrel_clusters.</p>
<p>Here are some links to find out more:</p>
<p><a href="http://brainspl.at/articles/search?q=nginx" target="blank">Ezra&#8217;s (creator of Merb) tips on running nginx</a></p>
<p><a href="http://wiki.codemongers.com/Main" target="blank">Official Nginx English wiki (apart from the Russian version- yes nginx was created by a russian)</a></p>
<img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/cheeyeo.wordpress.com/26/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/cheeyeo.wordpress.com/26/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/cheeyeo.wordpress.com/26/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/cheeyeo.wordpress.com/26/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/cheeyeo.wordpress.com/26/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=cheeyeo.wordpress.com&blog=3937360&post=26&subd=cheeyeo&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://cheeyeo.wordpress.com/2008/08/31/deploying-rails-part-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="" medium="image">
			<media:title type="html">cheeyeo</media:title>
		</media:content>

		<media:content url="http://cheeyeo.files.wordpress.com/2008/08/nginx.png" medium="image" />
	</item>
	</channel>
</rss>