<?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>sylv3rblade dot com &#187; Rails</title>
	<atom:link href="http://sylv3rblade.com/tag/rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://sylv3rblade.com</link>
	<description>Enjoying a Geek&#039;s Life with Anime, Rails, and Digital Photography!</description>
	<lastBuildDate>Thu, 02 Feb 2012 10:17:29 +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>uninitialized constant Rack::Test (NameError)</title>
		<link>http://sylv3rblade.com/2011/04/uninitialized-constant-racktest-nameerror/</link>
		<comments>http://sylv3rblade.com/2011/04/uninitialized-constant-racktest-nameerror/#comments</comments>
		<pubDate>Mon, 04 Apr 2011 01:13:43 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Cucumber]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Rails 2.0]]></category>
		<category><![CDATA[Rails 3.0]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=85</guid>
		<description><![CDATA[Cucumber-rails 0.4.0 was released for Rails 3.x. If you try to use it with anything below that (Rails 2.3.x), you&#8217;ll encounter the error: Is the rack-test driver missing? Nope. Well you still need that installed but the root cause of (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/04/uninitialized-constant-racktest-nameerror/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>Cucumber-rails 0.4.0 was released for Rails 3.x.  If you try to use it with anything below that (Rails 2.3.x), you&#8217;ll encounter the error:</p>
<pre class="brush: ruby; title: ; notranslate">
uninitialized constant Rack::Test (NameError)
</pre>
<p>Is the rack-test driver missing? Nope.  Well you still need that installed but the root cause of the breakage is lack of a proper test environment for Rails 2.3 whereas Rails 3.0 has this covered.  </p>
<p>The solution? Simple.</p>
<p>Use an older version of cucumber.  If you missed that from the first two sentences of the post then&#8230; <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> .</p>
<p>For me it works using this configuration for the config/cucumber.rb file (that&#8217;s our environment file, you can also opt to place this in your test.rb file instead):</p>
<pre class="brush: ruby; title: ; notranslate">
config.gem 'cucumber-rails',   :lib =&gt; false, :version =&gt; '0.3.2'
</pre>
<p>or if you&#8217;re using bundler:</p>
<pre class="brush: ruby; title: ; notranslate">
gem &quot;cucumber-rails&quot;, &quot;~&gt; 0.3.2&quot;
</pre>
<p>or if you&#8217;re really lazy and don&#8217;t have anything to automatically install gems for your environment:</p>
<pre class="brush: ruby; title: ; notranslate">
gem install cucumber-rails -v=0.3.2
</pre>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/04/uninitialized-constant-racktest-nameerror/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Resize or reprocess all Paperclip attachments</title>
		<link>http://sylv3rblade.com/2011/03/resize-or-reprocess-all-paperclip-attachments/</link>
		<comments>http://sylv3rblade.com/2011/03/resize-or-reprocess-all-paperclip-attachments/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 03:00:10 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Paperclip]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://sylv3rblade.com/?p=82</guid>
		<description><![CDATA[I&#8217;ve been using the Paperclip plugin/ gem for image attachment in several of my apps and I&#8217;ve encountered a scenario wherein I needed to change one of the styles configured in the model to accommodate the client&#8217;s request. At that (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/03/resize-or-reprocess-all-paperclip-attachments/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using the <a href="https://github.com/thoughtbot/paperclip">Paperclip</a> plugin/ gem for image attachment in several of my apps and I&#8217;ve encountered a scenario wherein I needed to change one of the styles configured in the model to accommodate the client&#8217;s request.  At that point, there are already a bunch of images in the project so I need to resize or in Paperclip&#8217;s terms reprocess all of them to fit the new configuration.</p>
<p>Here&#8217;s how I did it:</p>
<p>If you have paperclip installed as a plugin</p>
<p>If Paperclip is installed as a plugin, you can do this:</p>
<pre class="brush: ruby; title: ; notranslate">
rake paperclip:refresh:thumbnails CLASS=Attachment
</pre>
<p>Just replace Attachment with whatever classname you are using for with Paperclip</p>
<p>If it&#8217;s installed as a gem, do this inside script/console:</p>
<pre class="brush: ruby; title: ; notranslate">
Attachment.all.each {|s| s.logo.reprocess! if s.logo}
</pre>
<p>Just replace Attachment with whatever class name you are using for with Paperclip and logo with whatever attribute name you are using for the image.</p>
<p>And you&#8217;re done <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/03/resize-or-reprocess-all-paperclip-attachments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Hurrah!  A new server</title>
		<link>http://sylv3rblade.com/2011/01/hurrah-a-new-server/</link>
		<comments>http://sylv3rblade.com/2011/01/hurrah-a-new-server/#comments</comments>
		<pubDate>Thu, 20 Jan 2011 00:12:11 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[VPS]]></category>

		<guid isPermaLink="false">http://www.sylv3rblade.com/?p=57</guid>
		<description><![CDATA[I decided to move this blog together into a new VPS to host my personal rails projects . Now, I&#8217;m not sure if this&#8217;ll be a permanent thing since I sort of jumped on the offer upon impulse but so (&#8230;)</p><p><a href="http://sylv3rblade.com/2011/01/hurrah-a-new-server/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I decided to move this blog together into a new VPS to host my personal rails projects <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> .  Now, I&#8217;m not sure if this&#8217;ll be a permanent thing since I sort of jumped on the offer upon impulse but so far, I&#8217;m liking the service.</p>
<p>This server is running Ubuntu 10.4 with Pushion Passenger, Nginx, Ruby Enterprise Edition and PHP-FPM.  </p>
<p>So why Nginx and not Apache?  Well, aside from having it bundled with the latest version of Passenger, nginx historically has consumed less memory than Apache.  The trade off of course is that I&#8217;ll still be running ruby 1.8.7 but I guess that&#8217;s fine since some of the plugisn I&#8217;ve been using have conflicts with 1.9.x.</p>
<p>I&#8217;ll be pushing a post detailing how I configured this server in a bit.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2011/01/hurrah-a-new-server/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing the mysql gem on OS X 10.6 (Snow Leopard)</title>
		<link>http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/</link>
		<comments>http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 13:00:46 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[mysql gem]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.sylv3rblade.com/?p=21</guid>
		<description><![CDATA[The first thing on my developer itinerary after getting my MacBook Pro is to install my development tools. That includes upgrading the ruby and rails gem versions packaged with OS X 10.6 and installing Xcode which is included on Snow (&#8230;)</p><p><a href="http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.sylv3rblade.com/wp-content/uploads/2010/04/ruby-gem.png" alt="" title="MySQL Gem" width="117" height="113" class="alignright size-full wp-image-33" />The first thing on my developer itinerary after getting my MacBook Pro is to install my development tools.  That includes upgrading the ruby and rails gem versions packaged with OS X 10.6 and installing Xcode which is included on Snow Leopard&#8217;s install DVD.  Things proceed smoothly until I tried to install the mysql gem.</p>
<p>Ruby threw a fit and dumped this message:</p>
<pre class="brush: bash; title: ; notranslate">$ sudo gem install mysql
Building native extensions.  This could take a while...
ERROR:  Error installing mysql:
ERROR: Failed to build gem native extension.

Gem files will remain installed in /Library/Ruby/Gems/1.8/gems/mysql-2.8.1 for inspection.
Results logged to /Library/Ruby/Gems/1.8/gems/mysql-2.8.1/ext/mysql_api/gem_make.out
</pre>
<p>After some google-fu, I found out that when installing the mysql gem on OS X, you need to point it to where your mysql_config file is placed.  Below is the complete guide on how to how to install the mysql gem on Snow Leopard.</p>
<ul>
<li>Download your preferred MYSQL version from the <a href="http://dev.mysql.com/downloads/mysql/">community download site</a>.  If you&#8217;re on Snow Leopard, you may want to install the 64-bit version.</li>
<li>Install mysql via dmg or compile it from source.</li>
<li>Type &#8216;which mysql_config’ on the terminal to locate said config.  Take note of this location as we&#8217;ll use it on the next step.</li>
<li>Install the mysql gem with the command below.  If the location for your mysql config is different with the one below, use that instead.
<pre class="brush: bash; title: ; notranslate">
 sudo env ARCHFLAGS=&quot;-Os -arch x86_64 -fno-common&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
</pre>
<p>Note that if you&#8217;re using the 32-bit version, you have to use:</p>
<pre class="brush: bash; title: ; notranslate">
 sudo env ARCHFLAGS=&quot;-Os -arch i386 -fno-common&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
</pre>
</li>
<li>And success!
<pre class="brush: bash; title: ; notranslate">
$  sudo env ARCHFLAGS=&quot;-Os -arch x86_64 -fno-common&quot; gem install mysql -- --with-mysql-config=/usr/local/mysql/bin/mysql_config
Building native extensions.  This could take a while...
Successfully installed mysql-2.8.1
1 gem installed
Installing ri documentation for mysql-2.8.1...
...
</pre>
</li>
</ul>
<p>If you are having problems, or have any suggestions, please post a comment.</p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2010/04/installing-the-mysql-gem-on-os-x-10-6-snow-leopard/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>On Rails and Loving it :D</title>
		<link>http://sylv3rblade.com/2009/10/on-rails-and-loving-it-d/</link>
		<comments>http://sylv3rblade.com/2009/10/on-rails-and-loving-it-d/#comments</comments>
		<pubDate>Tue, 27 Oct 2009 12:26:32 +0000</pubDate>
		<dc:creator>sylv3rblade</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Rails]]></category>

		<guid isPermaLink="false">http://www.sylv3rblade.com/?p=3</guid>
		<description><![CDATA[I started out my official, programming career as a Java developer for my current company.  At the time, the design team was moving their development interests from purely desktop applications to a a more web-eccentric playing field, ergo web-based applications.  (&#8230;)</p><p><a href="http://sylv3rblade.com/2009/10/on-rails-and-loving-it-d/">Read the rest of this entry &#187;</a></p>]]></description>
			<content:encoded><![CDATA[<p>I started out my official, programming career as a Java developer for my current company.  At the time, the design team was moving their development interests from purely desktop applications to a a more web-eccentric playing field, ergo web-based applications.  The itinerary was to find out if the web was a viable platform (don&#8217;t laugh, we&#8217;re being headed by a bunch of old peeps who are still touchy about the current computing trends) for development.  My answer of course was yes, so I took up training as a Java Web developer.</p>
<p>Things were great but like most things Java, the going was SLOW but steady.</p>
<p><a href="http://www.sylv3rblade.com/wp-content/uploads/2009/10/ruby_on_rails_logo.jpg"><img class="alignright size-medium wp-image-5" title="ruby_on_rails_logo" src="http://www.sylv3rblade.com/wp-content/uploads/2009/10/ruby_on_rails_logo-252x300.jpg" alt="ruby_on_rails_logo" width="252" height="300" /></a>Then came Rails.</p>
<p>At first, I was really hesitant.  Strong typing (READ excessive typing) was the foundation of a good programming language; at least that&#8217;s what countless Java books that I&#8217;ve read told me.  So how does a language that puts the fun back in development catches attention?  Well, it might be cliche but&#8230;</p>
<h2>It all started with Hello World</h2>
<p>Nearly all programming languages starts with this old and tired way of displaying the text &#8220;Hello World&#8221;.  Ruby got me interested by it&#8217;s simplicity:</p>
<p>puts &#8216;Hello World&#8217;</p>
<p>and that&#8217;s it <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Of course that really doesn&#8217;t say much about the language&#8217;s capability but you have to admit that it&#8217;s bound to turn heads <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<h2>So why switch?</h2>
<p>At first it was really curiosity&#8230; although I will admit that I did already have Ruby experience prior to this via the gem WATIR (don&#8217;t ask why:D) but really, at one point I did ask myself, what&#8217;s all the fuss about Ruby on Rails?  So I started reading, reading&#8230; reading and then read some more until I decided that my first rails application would be the project we had for our Software Development lab subject back in college.  The result?  I&#8217;m in love <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>I&#8217;ll try sharing the project some time in the future but I have some re-writing to do <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />   It&#8217;s currently in workprint mode&#8230; it&#8217;s full of notes, comments and rants right in the source code so.. yeah I need to clean it first <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> .</p>
<p>- to be edited.  Need to sleep for now <img src='http://sylv3rblade.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://sylv3rblade.com/2009/10/on-rails-and-loving-it-d/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

