<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Robby on Rails: Category Ruby</title>
    <link>http://www.robbyonrails.com/articles/category/ruby</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>thoughts.sort_by{|t| t[:topic]}.collect </description>
    <item>
      <title>Ruby 1.8.7 on MacPorts causing some problems</title>
      <description>&lt;p&gt;It appears that MacPorts has upgraded to Ruby 1.8.7, which is good news if you&amp;#8217;re running Rails 2.1&amp;#8230; but if you have an older Rails application&amp;#8230; it&amp;#8217;s not going to work too well.&lt;/p&gt;


	&lt;p&gt;In order to get Ruby 1.8.6 installed with the latest MacPorts, you&amp;#8217;ll need to do the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ mkdir /Users/Shared/dports
&lt;/code&gt;&lt;/pre&gt;

&lt;pre&gt;&lt;code&gt;
$ svn checkout -r 36429 \ 
    http://svn.macports.org/repository/macports/trunk/dports/lang/ruby/ \ 
    /Users/Shared/dports/lang/ruby/
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Then you&amp;#8217;ll need to modify your macports to use this new local source. You&amp;#8217;ll need to edit &lt;code&gt;/opt/local/etc/macports/sources.conf&lt;/code&gt;  and add the following line above the existing rsync record.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;file:///Users/Shared/dports and create that directory&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Next, you&amp;#8217;ll want to index this new local source with the following command:&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;portindex /Users/Shared/dports&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;After that, you can do the following.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;sudo port uninstall rb-rubygems ruby&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;sudo port clean rb-rubygems ruby&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;sudo rm -r /opt/local/lib/ruby/gems/1.8/doc/rubygems-1.1.1/&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;sudo port deactivate autoconf&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;sudo port install ruby rb-rubygems&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;..and hopefully you&amp;#8217;ll have Ruby 1.8.6 installed and be able to retain the rubygems you installed already.&lt;/p&gt;
</description>
      <pubDate>Fri, 20 Jun 2008 16:11:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d949213f-ee18-44ed-a39f-a644f33289ca</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/06/20/ruby-1-8-7-on-macports-causing-some-problems</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>macports</category>
      <category>ruby</category>
      <category>rubygems</category>
    </item>
    <item>
      <title>I am forking Rails</title>
      <description>&lt;p&gt;...well, creating a fork on GitHub. ;-)&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/e32x/fork-rails"&gt;&lt;img src="http://img.skitch.com/20080402-7jfqp4wbc4h32q3cwysaincfa.preview.jpg" alt="fork rails" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;p&gt;It appears that Rails is moving from Subversion to Git!&lt;/p&gt;


	&lt;p&gt;Courtenay posted &lt;a href="http://blog.caboo.se/articles/2008/4/2/it-s-official-rails-moves-to-git"&gt;this&lt;/a&gt; a little while ago.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
git clone git://github.com/rails/rails.git
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Check it out the &lt;a href="http://github.com/rails"&gt;Ruby on Rails project&lt;/a&gt; on GitHub.&lt;/p&gt;


	&lt;p&gt;Start working on your next patch with git&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
git clone git://github.com/rails/rails.git
cd rails
git br -a
git br my_patch
git co my_patch
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This is cool news. :-)&lt;/p&gt;
</description>
      <pubDate>Wed, 02 Apr 2008 15:01:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:d06a69ee-8006-480f-92f7-6c0c3f53e9e6</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/04/02/forking-rails</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>git</category>
      <category>rubyonrails</category>
      <category>subversion</category>
      <category>github</category>
    </item>
    <item>
      <title>Tip: Link to Unimplemented</title>
      <description>&lt;p&gt;Throughout our design and development process, we&amp;#8217;re working around areas of the site that are not yet implemented but we also want to be able to allow our clients to demo their application. In an effort to manage their expectations, we need to be careful about what we link to. If a page/widget isn&amp;#8217;t ready to be demo&amp;#8217;d yet, we should avoid providing pathways to get interact with or navigate there. However, when we&amp;#8217;re implementing &lt;span class="caps"&gt;HTML&lt;/span&gt;/CSS for pages, it&amp;#8217;s sometimes makes sense to not hide certain things on the screen.&lt;/p&gt;


	&lt;p&gt;For example, let&amp;#8217;s suppose that you&amp;#8217;re working on the primary navigation of an application. You know what the other sections are going to be, but you&amp;#8217;ve only implemented a few of them so far. Your &lt;span class="caps"&gt;HTML&lt;/span&gt;/CSS person is working on the design for the navigation and wants to have them be proper links&amp;#8230; even to pages that don&amp;#8217;t yet exist.&lt;/p&gt;


	&lt;p&gt;One option, which is quite common, is to provide a link with &lt;code&gt;href="#"&lt;/code&gt;. This works to some extent, but when people click on things, they naturally expect something to happen in response.&lt;/p&gt;


	&lt;p&gt;This approach doesn&amp;#8217;t mesh well with our team as we don&amp;#8217;t really want to field any questions like, &amp;#8220;the navigation links are all broken. Nothing happens!&amp;#8221;&lt;/p&gt;


	&lt;p&gt;So, a pattern that we&amp;#8217;ve been using for a while is to trigger a javascript alert for every link within an implemented area that is linking to something that isn&amp;#8217;t yet implemented.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s take a really basic javascript function like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
# public/javascripts/application.js
function unimplemented() {
  alert("NOTICE\n\nThis feature is not implemented yet. Please check back again soon!");
}
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This allows us to do the following:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;a href="javascript:unimplemented();"&amp;gt;link text&amp;lt;/a&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;When someone clicks the link, they&amp;#8217;ll see a typical javascript alert message. This informs our clients/beta testers that we&amp;#8217;re paying attention to what works and what doesn&amp;#8217;t.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/ecx1/unimplemented"&gt;&lt;img src="http://img.skitch.com/20080327-pbcddnkj85bu6m9x7mspme5y6.preview.jpg" alt="unimplemented" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;p&gt;Let&amp;#8217;s take it a step further and push this into a view helper.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
# app/helpers/application_helper.rb
def link_to_unimplemented( link_text, *args )
  link_to_function( link_text, 'unimplemented()', *args)
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, we&amp;#8217;re able to use &lt;code&gt;link_to_unimplemented&lt;/code&gt; and pass any arguments that you&amp;#8217;d pass to the default &lt;code&gt;link_to&lt;/code&gt; view helper.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
&amp;lt;%= link_to_unimplemented( 'link text', { :class =&amp;gt; 'link_class_name' } ) -%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now our web designers can go about their work and use this helper as necessary.&lt;/p&gt;


	&lt;p&gt;An nice benefit for doing this is that we have a pattern that we follow so that we can rely upon to make sure that we don&amp;#8217;t forget anything. This is the equivalent of adding @TODO@s throughout our code base.&lt;/p&gt;


	&lt;p&gt;If we search through &lt;code&gt;app/views&lt;/code&gt; for &amp;#8216;&lt;strong&gt;&lt;code&gt;link_to_unimplemented&lt;/code&gt;&lt;/strong&gt;&amp;#8217; we should be able to prevent missing any broken links. In the next screenshot, I&amp;#8217;m using &lt;code&gt;grep&lt;/code&gt; with colorized matches.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/ecxh/unimplemented-2"&gt;&lt;img src="http://img.skitch.com/20080327-eg83hqhgpspk4n71hquswjpasf.preview.jpg" alt="unimplemented 2" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt; 

	&lt;p&gt;As you can see, we have something left to implement in that area of the application. :-)&lt;/p&gt;


	&lt;p&gt;This has been one of those lightweight patterns that we&amp;#8217;ve been able to adopt and it&amp;#8217;s definitely helped manage the expectations of our clients throughout our development process.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d love to hear your thoughts on this. How does your team handle things like this?&lt;/p&gt;


	&lt;h2&gt;Related Posts&lt;/h2&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.robbyonrails.com/articles/2007/08/01/designers-developers-and-the-x_-factor"&gt;Designers, Developers, and the x_ Factor&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://www.robbyonrails.com/articles/2007/10/06/spice-up-your-terminal-with-colored-grep-pattern-results"&gt;Spice up your Terminal with colored grep pattern results&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
</description>
      <pubDate>Thu, 27 Mar 2008 06:10:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:f2aad3fb-9728-4db3-8504-a7bf2bd76b24</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/27/tip-link-to-unimplemented</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>clients</category>
      <category>javascript</category>
      <category>helper</category>
      <category>development</category>
      <category>design</category>
      <category>html</category>
      <category>tip</category>
    </item>
    <item>
      <title>Managing Required Gems on Rails Projects</title>
      <description>&lt;p&gt;We&amp;#8217;re starting a new project and I&amp;#8217;m finding myself adding things to the code base that we&amp;#8217;ve done in the past&amp;#8230; hence the last few posts. As we&amp;#8217;re doing this, I&amp;#8217;d like to highlight some of the little things that we do on each project to maintain some consistency and in that process reach out to the community for alternative approaches.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m intrigued by the &lt;a href="http://errtheblog.com/posts/50-vendor-everything"&gt;vendor everything&lt;/a&gt; concept, but we haven&amp;#8217;t yet adopted this on any of our projects (yet).&lt;/p&gt;


	&lt;p&gt;What we have been doing is to maintain a &lt;code&gt;REQUIRED_GEMS&lt;/code&gt; file in the root directory of our Rails application.&lt;/p&gt;


	&lt;p&gt;For example:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ cat REQUIRED_GEMS

actionmailer
actionpack
actionwebservice
activerecord
activesupport
cgi_multipart_eof_fix
daemons
fastercsv
fastthread
feedtools
gem_plugin
image_science
mongrel
mongrel_cluster
mysql
rails
rake
RedCloth
Ruby-MemCache
soap4r
uuidtools
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Everybody on the team (designers/developers) knows to look here to make sure they have everything installed when beginning to work on the application.&lt;/p&gt;


	&lt;p&gt;This has worked fairly well from project to project but since we&amp;#8217;re starting a new project, I&amp;#8217;m curious if anybody has some better ways to approach this. Should we look more seriously at the vendor everything approach or are there any alternative approaches?&lt;/p&gt;
</description>
      <pubDate>Wed, 26 Mar 2008 22:27:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:1dad9e29-fb50-447c-802d-1a0f6109ff1d</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/26/managing-required-gems-on-rails-projects</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>gems</category>
      <category>rubyonrails</category>
      <category>ruby</category>
      <category>rails</category>
      <category>workflow</category>
      <category>team</category>
      <category>planetargon</category>
      <category>question</category>
      <category>tip</category>
    </item>
    <item>
      <title>Managing SEO-friendly HTML Titles with Rails</title>
      <description>&lt;p&gt;I&amp;#8217;ve seen this come up a few times in the #rubyonrails &lt;span class="caps"&gt;IRC&lt;/span&gt; channel and figured that I&amp;#8217;d post a quick entry for future reference.&lt;/p&gt;


	&lt;h2&gt;Problem: &lt;span class="caps"&gt;HTML&lt;/span&gt; titles&lt;/h2&gt;


	&lt;p&gt;&lt;strong&gt;You want to have a clean way to manage the titles on your &lt;span class="caps"&gt;HTML&lt;/span&gt; pages.&lt;/strong&gt;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;html&amp;gt;
    &amp;lt;head&amp;gt;
      &amp;lt;title&amp;gt;Robby on Rails &amp;amp;mdash; Article Title Goes Here&amp;lt;/title&amp;gt;
    &amp;lt;/head&amp;gt;
    &amp;lt;body&amp;gt;
      ...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Possible Solution(s):&lt;/p&gt;


	&lt;p&gt;Since the &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; tag is usually declared in your layout, you need to be able to dynamically update this information from almost every action in your application.&lt;/p&gt;


	&lt;p&gt;Here are a few ways that I&amp;#8217;ve seen this handled.&lt;/p&gt;


	&lt;ol&gt;
	&lt;li&gt;Use a instance variable, which would have a default value and you could override it in any controller action&lt;/li&gt;
		&lt;li&gt;Use the &lt;code&gt;content_for&lt;/code&gt; method to manage it.&lt;/li&gt;
	&lt;/ol&gt;


	&lt;p&gt;Let&amp;#8217;s take a few minutes to look at these two approaches.&lt;/p&gt;


	&lt;h3&gt;Instance Variable&lt;/h3&gt;


	&lt;p&gt;With the instance variable, you might end up with something like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/views/layouts/application.html.erb
  &amp;lt;title&amp;gt;Robby on Rails &amp;amp;mdash; &amp;lt;%= @html_title || 'Default text here...' -%&amp;gt;&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Then in a controller action&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/controllers/articles_controller.rb
  def show
    # ...
    @html_title = @article.title
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;So, that&amp;#8217;s one way to handle it and is probably a more common way.&lt;/p&gt;


	&lt;h3&gt;The &lt;code&gt;content_for&lt;/code&gt; helper method approach&lt;/h3&gt;


	&lt;p&gt;This solution is very similar (and underneath uses an instance variable).&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;ll use the &lt;a href="http://api.rubyonrails.org/classes/ActionView/Helpers/CaptureHelper.html#M001069"&gt;content_for&lt;/a&gt; and a little &lt;code&gt;yield&lt;/code&gt; action.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/views/layouts/application.html.erb
  &amp;lt;title&amp;gt;Robby on Rails &amp;lt;%= (html_title = yield :html_title) ? html_title : '&amp;amp;mdash; Default text here...' %&amp;gt;&amp;lt;/title&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Then we&amp;#8217;ll create a helper method.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/helpers/application_helper.rb
  def set_html_title(str="")
    unless str.blank?
      content_for :html_title do
       "&amp;amp;mdash; #{str} " 
      end
    end
  end  
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, instead of defining the &lt;span class="caps"&gt;HTML&lt;/span&gt; &lt;code&gt;&amp;lt;title&amp;gt;&lt;/code&gt; value in the controllers, we&amp;#8217;ll just toss this into our html.erb files as necessary.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;% set_html_title(@article.name) -%&amp;gt;
  ... rest of view
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;..and that&amp;#8217;s pretty much it.&lt;/p&gt;


	&lt;h3&gt;Which is the better solution?&lt;/h3&gt;


	&lt;p&gt;This is where we&amp;#8217;ll not find a lot of consensus amongst people. I&amp;#8217;m a fan of the &lt;code&gt;content_for&lt;/code&gt;-based approach and defining the title in views rather than in controller actions. I&amp;#8217;m an advocate of skinny controllers and while I&amp;#8217;m not a big fan of messy views, I believe that there is less overhead in managing this within the View-world.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;d love to hear your thoughts on this. Perhaps you have a more eloquent for managing things like this? Do share. :-)&lt;/p&gt;
</description>
      <pubDate>Wed, 26 Mar 2008 16:41:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:de684f82-efe6-48b6-a6f5-68ea542d72ef</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/26/managing-seo-friendly-html-titles-with-rails</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>html</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>helpers</category>
    </item>
    <item>
      <title>Things (in the Rails world) You Don't Yet Understand</title>
      <description>&lt;p&gt;This is inspired by a recent post by Seth Godin titled, &lt;a href="http://sethgodin.typepad.com/seths_blog/2008/03/things-you-dont.html"&gt;Things you don&amp;#8217;t understand&lt;/a&gt;, where he shared a list of things that he probably could understand if he put your mind to it, but doesn&amp;#8217;t. I decided to post a list of five (5) things in response within the context of Ruby/Rails.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m really interested in various things but am really unable to prioritize them high enough to spend the time to understand them.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;RSpec User Stories&lt;/li&gt;
		&lt;li&gt;Using Selenium with RSpec&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://jquery.com/"&gt;JQuery&lt;/a&gt; (&lt;a href="http://blog.imperialdune.com/"&gt;Graeme&lt;/a&gt; speaks highly of it)&lt;/li&gt;
		&lt;li&gt;&lt;a href="http://code.google.com/p/jsspec/"&gt;JSSpec&lt;/a&gt; (BDD for Javascript)&lt;/li&gt;
		&lt;li&gt;Using the Google Charts &lt;span class="caps"&gt;API&lt;/span&gt; with Rails&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;What about you? What&amp;#8217;s your list of things that you&amp;#8217;d like to understand more about?&lt;/p&gt;
</description>
      <pubDate>Tue, 25 Mar 2008 10:12:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:2ad10b2f-7185-4d43-bc2e-1e881281f1c5</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/25/things-in-the-rails-world-you-dont-yet-understand</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>question</category>
      <category>rspec</category>
      <category>jquery</category>
      <category>javascript</category>
      <category>ruby</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>google</category>
      <category>charts</category>
      <category>godin</category>
    </item>
    <item>
      <title>DRY(a): Year After Year</title>
      <description>&lt;p&gt;I&amp;#8217;m guilty of it. Many of you are likely guilty of it&amp;#8230; and I know that several customers of our &lt;a href="http://www.robbyonrails.com/articles/2007/06/17/audit-your-rails-development-team"&gt;Rails Code Audit and Review service&lt;/a&gt; are guilty of it.&lt;/p&gt;


	&lt;p&gt;How many times have you realized (after a few months has passed) that your Copyright date/year on your web site was no longer current?&lt;/p&gt;


	&lt;p&gt;How many of you had the same problem last year? The year before?&lt;/p&gt;


	&lt;p&gt;Let me share some advice with you all&amp;#8230; &lt;span class="caps"&gt;DRY&lt;/span&gt; (a)!&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Don&amp;#8217;t Repeat Yourself (again)!&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;This is really a simple problem to fix but when we&amp;#8217;re busy tackling bigger problems&amp;#8230; little things like this slip by. Don&amp;#8217;t worry, you&amp;#8217;re not the only one who was reminded by a colleague three months into the year that you forgot to update this.&lt;/p&gt;


	&lt;p&gt;On client projects, we have a handful of helpers that we drop into the application. We&amp;#8217;re starting to extract more of these into plugins and will be releasing those as time permits. It just happened that I found myself looking at yet-another Rails code base this afternoon that was showing 2007 in the footer. An easily forgivable offense.. but if you&amp;#8217;re going to go in there and change it (again), &lt;em&gt;take a moment to do the right thing&lt;/em&gt;. ;-)&lt;/p&gt;


	&lt;p&gt;Our solution at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; on client projects is to create a basic view helper that renders the current year. This allows us to do the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;div id="footer"&amp;gt;
    &amp;amp;copy; Copyright &amp;lt;%= current_year -%&amp;gt;. All Rights Reserved.
  &amp;lt;/div&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The helper code looks like:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # add to application_helper.rb
  module ApplicationHelper
    def current_year
      Time.now.strftime('%Y')
    end
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Voila. Not rocket science.. is it?&lt;/p&gt;


	&lt;p&gt;Guess what? I&amp;#8217;m getting really tired of adding this to every Rails project that I touch. So, I bottled this little gem into a new Rails plugin that we&amp;#8217;ll just add to future projects.&lt;/p&gt;


	&lt;h2&gt;Introducing Year after Year&lt;/h2&gt;


	&lt;p&gt;This is really the smallest plugin that I could put together (and it includes specs!)&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;What does it provide you?&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;YearAfterYear will provide you a helper that will render the current year (dynamically)! That&amp;#8217;s right&amp;#8230; just add the plugin to your Rails application and you too can enjoy New Years 2009 without having to have a deployment ready with a one line change from 2008 to 2009!&lt;/p&gt;


	&lt;p&gt;To use.. add the following to any view from within Ruby on Rails.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= current_year -%&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Installation&lt;/h3&gt;


	&lt;p&gt;As I&amp;#8217;m using git, you&amp;#8217;ll need to grab this and put it into &lt;code&gt;vendor/plugins&lt;/code&gt;. That&amp;#8217;s it!&lt;/p&gt;


	&lt;p&gt;You can grab it on &lt;a href="http://github.com"&gt;GitHub&lt;/a&gt;!&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://github.com/robbyrussell/year_after_year/"&gt;http://github.com/robbyrussell/year_after_year/&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Bugs / Feature Requests &lt;a href="http://planetargon.lighthouseapp.com/projects/5187-open-source-projects/tickets"&gt;here&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Happy New Years (8+ months early)!&lt;/p&gt;


	&lt;p&gt;Just a friendly reminder to not forget the small stuff&amp;#8230; because your visitors will notice! ;-)&lt;/p&gt;


	&lt;h3&gt;Updates&amp;#8230;&lt;/h3&gt;


	&lt;p&gt;I got a few requests for this to also provide a range of years for people who like to do: &lt;strong&gt;2005-2007&lt;/strong&gt;. So this is now provided as well.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;year_range(start_year)&lt;/code&gt;&lt;/p&gt;


Example:
&lt;pre&gt;&lt;code&gt;
  &amp;lt;%= year_range(2005) %&amp;gt; # =&amp;gt; 2005-2008
&lt;/code&gt;&lt;/pre&gt;
</description>
      <pubDate>Mon, 24 Mar 2008 22:05:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4228a063-facc-4a13-bdb0-342c0fab415e</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/03/24/dry-a-year-after-year</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>sarcasm</category>
      <category>plugin</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>years</category>
      <category>copyrights</category>
      <category>joke</category>
      <category>plugins</category>
    </item>
    <item>
      <title>Deploying Rails with an interactive Capistrano recipe to your Boxcar</title>
      <description>&lt;p&gt;I wanted to share something that I&amp;#8217;ve been meaning to share on here.&lt;/p&gt;


	&lt;p&gt;When we began planning &lt;a href="http://railsboxcar.com"&gt;Rails Boxcar&lt;/a&gt;, we really want to reduce the amount of work that it took to setup and deploy a &lt;span class="caps"&gt;VPS&lt;/span&gt; for a Rails application. During this period, we began to look at the deployment process itself and began working on an interactive tool for developers for setting up their deployment environment on their Boxcar instances. So, we worked with few customers to develop an interactive Capistrano recipe.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;The Goal?&lt;/strong&gt; Spend less time configuring the server or editing recipe files.&lt;/p&gt;


	&lt;p&gt;During the initial setup, we can have the customer provide a few details from the safety of their Rails application directory by answering the following.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;What database server will you be using? (PostgreSQL or MySQL)&lt;/li&gt;
		&lt;li&gt;What port does your database run on? (if different than the default for your db server)&lt;/li&gt;
		&lt;li&gt;What is your database username?&lt;/li&gt;
		&lt;li&gt;What is your database user&amp;#8217;s password?&lt;/li&gt;
		&lt;li&gt;What port will your mongrel cluster start with? &lt;/li&gt;
		&lt;li&gt;How many mongrel servers should your cluster run?&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Great&amp;#8230; setup the server and let&amp;#8217;s deploy!&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/bsx8/default"&gt;&lt;img src="http://img.skitch.com/20080228-x5rksmf1b7dkx1x57spsr9rwr9.preview.jpg" alt="Default" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;&lt;small&gt;Feel free to snag our &lt;a href="http://pastie.caboo.se/99450"&gt;interactive Capistrano2 recipe&lt;/a&gt;. &lt;/small&gt;

	&lt;p&gt;We&amp;#8217;re trying to take the pain out of deploying your Ruby on Rails applications with &lt;a href="http://railsboxcar.com/"&gt;Boxcar&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;On a side note, we&amp;#8217;re in the process of expanding our team and &lt;a href="http://blog.planetargon.com/2008/2/20/welcome-alex"&gt;recently hired Alex Malinovich&lt;/a&gt;. Do stay tuned as we&amp;#8217;ll be posting important announcements about changes to our &lt;a href="http://planetargon.com/hosting.html"&gt;Rails hosting services&lt;/a&gt; in the next few weeks. (&lt;strong&gt;grin&lt;/strong&gt;)&lt;/p&gt;
</description>
      <pubDate>Thu, 28 Feb 2008 16:27:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:48a471b7-2cbe-445e-b82f-f0933288d293</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/02/28/deploying-rails-with-an-interactive-capistrano-recipe-to-your-boxcar</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>PLANET ARGON</category>
      <category>boxcar</category>
      <category>deployment</category>
      <category>rails</category>
      <category>ruby</category>
      <category>capistrano</category>
      <category>hosting</category>
    </item>
    <item>
      <title>Installing Ruby on Rails and PostgreSQL on OS X, Third Edition</title>
      <description>&lt;p&gt;Over the past few years, I&amp;#8217;ve helped you walk through the process of getting Ruby on Rails up and running on Mac &lt;span class="caps"&gt;OS X&lt;/span&gt;. The last version has been getting a lot of comments related to issues with the new Apple Leopard, so I&amp;#8217;m going this post will expand on previous installation guides with what&amp;#8217;s working for me as of January 2008.&lt;/p&gt;


	&lt;p&gt;The following guide is how our development team at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; prefers to setup our development workstations&lt;/p&gt;


	&lt;p&gt;During this installation, we&amp;#8217;ll have what we feel is the optimal development stack for building &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt; applications with our favorite database server, &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Ready? Let&amp;#8217;s get started&amp;#8230;&lt;/p&gt;
&lt;h2&gt;Phase One&lt;/h2&gt;


	&lt;p&gt;During this initial phase, we&amp;#8217;re going to install the underlying dependencies that we&amp;#8217;ll be building off of.&lt;/p&gt;


	&lt;h3&gt;XCode 3.0&lt;/h3&gt;


	&lt;p&gt;The first thing that you&amp;#8217;ll need to install to get far with this process is XCode tools, which is distributed by Apple. You can find this on the &lt;span class="caps"&gt;DVD&lt;/span&gt; that your Leopard installer is on. You can also download the latest version from Apple&amp;#8217;s developer site.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://developer.apple.com/tools/download/"&gt;http://developer.apple.com/tools/download/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;The current version (3.0) is 1.1 GB.. so the download time will vary depending on your connection speed. I would encourage you to drink some tea and/or &lt;a href="http://www.amazon.com/gp/product/0684868768?ie=UTF8&amp;#38;tag=robonrai-20&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;creativeASIN=0684868768"&gt;read a book&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=robonrai-20&amp;#38;l=as2&amp;#38;o=1&amp;#38;a=0684868768" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt;&lt;/p&gt;


	&lt;p&gt;Once you finish the installation, you can move forward. The rest of these installation &lt;strong&gt;will not work&lt;/strong&gt; until XCode is installed. :-)&lt;/p&gt;


	&lt;h3&gt;MacPorts&lt;/h3&gt;


	&lt;p&gt;In this next step, we&amp;#8217;ll install &lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; (formerly known as DarwinPorts). The MacPorts web site describes itself as, &lt;em&gt;&amp;#8220;an open-source community initiative to design an easy-to-use system for compiling, installing, and upgrading either command-line, &lt;span class="caps"&gt;X11&lt;/span&gt; or Aqua based open-source software on the Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; operating system.&amp;#8221;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://img.skitch.com/20080122-jxqkyy8hc8ug7qxy4jt6qeg3d1.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;This tool is about to become one of the most important tools on your operating system as it&amp;#8217;ll be used time and time again to maintain your libraries and many of the Unix tools that you&amp;#8217;ll be using. If you’re from the Linux or &lt;span class="caps"&gt;BSD&lt;/span&gt; world, you are likely familiar with similar tools… such as: apt-get, port, and yum.&lt;/p&gt;


	&lt;p&gt;First, you&amp;#8217;ll want to download MacPorts and install the &amp;#8220;dmg&amp;#8221; disk file for Leopard at the following link.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.macports.org/install.php"&gt;http://www.macports.org/install.php&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Once downloaded, you&amp;#8217;ll want to run the installer and install it on your workstation.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdqg/install-macports-1.6.0"&gt;&lt;img src="http://img.skitch.com/20080122-efm4gb9pbb79p4ujya1ceisn37.preview.jpg" alt="Install MacPorts-1.6.0" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;Work you way through the installer until successfully installed.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdqe/install-macports-1.6.0"&gt;&lt;img src="http://img.skitch.com/20080122-rr9e1begkg73ixt11d697wpdfh.preview.jpg" alt="Install MacPorts-1.6.0" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;Once this finishes, you can open up your favorite terminal application and run the following to test that it installed properly.&lt;/p&gt;


	&lt;p&gt;In my case, I&amp;#8217;m now using Terminal.app.&lt;/p&gt;


	&lt;p&gt;Issue the command: &lt;code&gt;/opt/local/bin/port version&lt;/code&gt;&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdqm/opt-local-bin-port-version"&gt;&lt;img src="http://img.skitch.com/20080122-piqes1e66rgj1bui7eud9sisf7.preview.jpg" alt="_opt_local_bin_port version" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;If it responds with a version number like mine did in the screenshot above, we&amp;#8217;re moving along nicely.&lt;/p&gt;


	&lt;h3&gt;Environment Paths&lt;/h3&gt;


	&lt;p&gt;When we install MacPorts, the command to install/update ports installed to &lt;code&gt;/opt/local/bin&lt;/code&gt;. We had to provide the entire path as this isn&amp;#8217;t currently showing up in the default &lt;code&gt;$PATH&lt;/code&gt; on Leopard. Let&amp;#8217;s quickly remedy this by modifying the file &lt;code&gt;/etc/profile&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;If you have Textmate installed, you can run the following from your terminal: &lt;code&gt;mate /etc/profile&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Add the following line to the bottom of &lt;code&gt;/etc/profile&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;export PATH=/opt/local/bin:/opt/local/sbin:$PATH&lt;/code&gt;&lt;/pre&gt;

&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdxb/profile"&gt;&lt;img src="http://img.skitch.com/20080122-mqk8awqpbeebmdq7p7r1gyixsy.preview.jpg" alt="profile" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;You can use your favorite editor to update this file. Once you save it, you&amp;#8217;ll want to restart your terminal application (or open a new tab) to create a new session. When your new terminal opens, run the following to verify that &lt;code&gt;port&lt;/code&gt; is showing up in your &lt;code&gt;$PATH&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;which port&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;You should see &lt;code&gt;/opt/local/bin/port&lt;/code&gt; show up as the result of this command.&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdx8/which-port"&gt;&lt;img src="http://img.skitch.com/20080122-d4hte4cm5gn67a4cum26gbibut.preview.jpg" alt="which port" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;Great, let&amp;#8217;s continue to move forward.&lt;/p&gt;


	&lt;h3&gt;Hiding Apple&amp;#8217;s Ruby, Gems, and Rails&lt;/h3&gt;


	&lt;p&gt;Before we install Ruby from MacPorts, we&amp;#8217;ll go ahead and hide Apple&amp;#8217;s Ruby installations.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
    :~ robbyrussell$ sudo su -
    Password:
    :~ root# mv /usr/bin/ruby /usr/bin/ruby.orig
    :~ root# mv /usr/bin/gem /usr/bin/gem.orig
    :~ root# mv /usr/bin/rails /usr/bin/rails.orig
    :~ root# logout    
&lt;/code&gt;&lt;/pre&gt;

&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/fdxe/hiding-apples-ruby"&gt;&lt;img src="http://img.skitch.com/20080122-rgmsuy746h73b1bc93j4nyi5ar.preview.jpg" alt="hiding apples ruby" /&gt;&lt;/a&gt;&lt;/div&gt;

	&lt;p&gt;If you ever decide to remove MacPorts, you can just rename &lt;code&gt;ruby.orig&lt;/code&gt; back to &lt;code&gt;ruby&lt;/code&gt; and you&amp;#8217;re back where you started&amp;#8230; and the same for the others listed.&lt;/p&gt;


	&lt;h2&gt;Phase Two&lt;/h2&gt;


	&lt;p&gt;During this next phase, we&amp;#8217;re going to install Ruby and Ruby on Rails.&lt;/p&gt;


	&lt;h3&gt;Installing Ruby via MacPorts&lt;/h3&gt;


	&lt;p&gt;Now that we have MacPorts up and running, we&amp;#8217;re going to use it for the first time. We&amp;#8217;ll start by using it to install Ruby and the Rubygems package.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo port install ruby rb-rubygems&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Okay, this will take a little while. I&amp;#8217;d suggest that you step out to get some fresh air.&lt;/p&gt;


	&lt;p&gt;How was it outside? What&amp;#8217;s the weather like there today? It&amp;#8217;s currently 2:30am &lt;span class="caps"&gt;PST&lt;/span&gt; so it&amp;#8217;s dark and an 28F outside so I didn&amp;#8217;t stay outside very long.&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re still waiting for it to install, perhaps you could watch the following video. I might encourage you to check out more of &lt;a href="http://en.wikipedia.org/wiki/Jam_%28TV_series%29"&gt;Jam&lt;/a&gt;, which was recommended a few years ago to me by &lt;a href="http://interblah.net/"&gt;James Adam&lt;/a&gt; at &lt;a href="http://www.canadaonrails.org/"&gt;Canada on Rails&lt;/a&gt;.&lt;/p&gt;


&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/sLD0SNCFtyA&amp;#38;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/sLD0SNCFtyA&amp;#38;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;

	&lt;p&gt;Be warned&amp;#8230; it&amp;#8217;s a strange show, but I find strange things like this funny. :-)&lt;/p&gt;


	&lt;p&gt;If you prefer something a bit more lighthearted&amp;#8230;&lt;/p&gt;


&lt;object width="425" height="355"&gt;&lt;param name="movie" value="http://www.youtube.com/v/SO5WoLnOOlU&amp;#38;rel=1"&gt;&lt;/param&gt;&lt;param name="wmode" value="transparent"&gt;&lt;/param&gt;&lt;embed src="http://www.youtube.com/v/SO5WoLnOOlU&amp;#38;rel=1" type="application/x-shockwave-flash" wmode="transparent" width="425" height="355"&gt;&lt;/embed&gt;&lt;/object&gt;

	&lt;p&gt;Okay&amp;#8230; when Ruby finishes installing, you&amp;#8217;ll want to test that you can run it.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ ruby -v&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, let&amp;#8217;s move forward!&lt;/p&gt;


	&lt;h3&gt;Installing Ruby on Rails via RubyGems&lt;/h3&gt;


	&lt;p&gt;We&amp;#8217;re now going to install the libraries that make up Ruby on Rails via RubyGems.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo gem install --include-dependencies rails&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This will install the following gems.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;rails-2.0.2&lt;/li&gt;
		&lt;li&gt;rake-0.8.1&lt;/li&gt;
		&lt;li&gt;activesupport-2.0.2&lt;/li&gt;
		&lt;li&gt;activerecord-2.0.2&lt;/li&gt;
		&lt;li&gt;actionpack-2.0.2&lt;/li&gt;
		&lt;li&gt;actionmailer-2.0.2&lt;/li&gt;
		&lt;li&gt;activeresource-2.0.2&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Excellent, let&amp;#8217;s move forward&amp;#8230;&lt;/p&gt;


	&lt;p&gt;If you haven&amp;#8217;t already purchased it, I recommend that you take a look at &lt;a href="http://www.amazon.com/gp/product/0321445619?ie=UTF8&amp;#38;tag=robonrai-20&amp;#38;linkCode=as2&amp;#38;camp=1789&amp;#38;creative=9325&amp;#38;creativeASIN=0321445619"&gt;The Rails Way (Addison-Wesley Professional Ruby Series)&lt;/a&gt;&lt;img src="http://www.assoc-amazon.com/e/ir?t=robonrai-20&amp;#38;l=as2&amp;#38;o=1&amp;#38;a=0321445619" width="1" height="1" border="0" alt="" style="border:none !important; margin:0px !important;" /&gt; by Obie Fernandez.&lt;/p&gt;


	&lt;h3&gt;Installing Mongrel via RubyGems&lt;/h3&gt;


	&lt;p&gt;Let&amp;#8217;s now install Mongrel, which is an excellent Ruby-based web server for Ruby on Rails applications. We use it in development and production at &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt; and it&amp;#8217;s also what we recommend to our &lt;a href="http://planetargon.com/hosting.html"&gt;hosting customers&lt;/a&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo gem install --include-dependencies mongrel mongrel_cluster&lt;/code&gt;&lt;/pre&gt;

	&lt;ul&gt;
	&lt;li&gt;&lt;strong&gt;Note:&lt;/strong&gt; Be sure to select the proper platform for mongrel. (hint: &lt;span class="caps"&gt;OS X&lt;/span&gt; is &lt;span class="caps"&gt;NOT&lt;/span&gt; mswin32)&lt;/li&gt;
	&lt;/ul&gt;


My terminal output:
&lt;pre&gt;&lt;code&gt;
Select which gem to install for your platform (i686-darwin9.1.0)
 1. mongrel 1.1.3 (java)
 2. mongrel 1.1.3 (i386-mswin32)
 3. mongrel 1.1.3 (ruby)
 4. mongrel 1.1.2 (ruby)
 5. mongrel 1.1.2 (mswin32)
 6. mongrel 1.1.2 (java)
 7. Skip this gem
 8. Cancel installation
&amp;gt; 3
Select which gem to install for your platform (i686-darwin9.1.0)
 1. fastthread 1.0.1 (mswin32)
 2. fastthread 1.0.1 (ruby)
 3. Skip this gem
 4. Cancel installation
&amp;gt; 2
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed mongrel-1.1.3
Successfully installed gem_plugin-0.2.3
Successfully installed daemons-1.0.9
Successfully installed fastthread-1.0.1
Successfully installed cgi_multipart_eof_fix-2.5.0
Installing ri documentation for mongrel-1.1.3...
Installing ri documentation for gem_plugin-0.2.3...
Installing ri documentation for daemons-1.0.9...
Installing ri documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing ri documentation for cgi_multipart_eof_fix-2.5.0...
Installing RDoc documentation for mongrel-1.1.3...
Installing RDoc documentation for gem_plugin-0.2.3...
Installing RDoc documentation for daemons-1.0.9...
Installing RDoc documentation for fastthread-1.0.1...

No definition for dummy_dump

No definition for dummy_dump

No definition for rb_queue_marshal_load

No definition for rb_queue_marshal_dump
Installing RDoc documentation for cgi_multipart_eof_fix-2.5.0...
Successfully installed mongrel_cluster-1.0.5
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, you have almost all of the essentials.. except a database.&lt;/p&gt;


	&lt;h2&gt;Phase Three&lt;/h2&gt;


	&lt;p&gt;In this phase, we&amp;#8217;re going to get our database server, PostgreSQL, installed and the libraries that Ruby needs to communicate with it.&lt;/p&gt;


	&lt;h3&gt;Installing PosgreSQL with MacPorts&lt;/h3&gt;


	&lt;p&gt;At &lt;a href="http://planetargon.com"&gt;Planet Argon&lt;/a&gt;, we design and develop our applications on top of &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt;. I’ve been advocating the adoption of this awesome open source database in the Rails community for quite some time now.&lt;/p&gt;


	&lt;p&gt;The current version available of PostgreSQL via MacPorts is 8.3, which is what we&amp;#8217;ll now install with the &lt;code&gt;port&lt;/code&gt; command.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;$ sudo port install postgresql83 postgresql83-server&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;This will download and install the necessary libraries to run PostgreSQL server and the client utilities.&lt;/p&gt;


	&lt;h3&gt;Configuring PostgreSQL&lt;/h3&gt;


	&lt;p&gt;When PostgreSQL is finished installing, it&amp;#8217;ll tell you to run the following commands to create a new database instance.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
 sudo mkdir -p /opt/local/var/db/postgresql83/defaultdb
 sudo chown postgres:postgres /opt/local/var/db/postgresql83/defaultdb
 sudo su postgres -c '/opt/local/lib/postgresql83/bin/initdb -D /opt/local/var/db/postgresql83/defaultdb'
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Adding PostgreSQL to launchd&lt;/h4&gt;


	&lt;p&gt;If you&amp;#8217;d like to have PostgreSQL automatically startup after a system restart, you can load it into launchd, which comes with &lt;span class="caps"&gt;OS X&lt;/span&gt;. By running the following command, PostgreSQL will startup automatically on the next system restart.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql83-server.plist&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Adding PostgreSQL to your $PATH&lt;/h4&gt;


	&lt;p&gt;For some reason, the MacPort for PostgreSQL doesn&amp;#8217;t get the programs in your path automatically, so we&amp;#8217;ll it now.&lt;/p&gt;


	&lt;p&gt;&lt;code&gt;mate /etc/profile&lt;/code&gt;&lt;/p&gt;


	&lt;p&gt;Modify the &lt;code&gt;PATH&lt;/code&gt; that we changed earlier to include /opt/local/lib/postgresql83/bin@.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;export PATH=/opt/local/bin:/opt/local/sbin:/opt/local/lib/postgresql83/bin:$PATH&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Save the file and then open a new terminal. To test this, you should get the following output when you run which &lt;code&gt;psql&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ which psql
  /opt/local/lib/postgresql83/bin/psql    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Creating a new PostgreSQL user&lt;/h4&gt;


	&lt;p&gt;When I’m working on Rails applications in my development environment, I really don’t want to have to specify a username and password in every &lt;code&gt;config/database.yml&lt;/code&gt; file for each of our ongoing client projects. When PostgreSQL was installed, it created a superuser named &lt;strong&gt;postgres&lt;/strong&gt;, which is great, but I’d like one that matches my system username, so that I’m not prompted at all for a username or password to connect to PostgreSQL.&lt;/p&gt;


	&lt;p&gt;To do this, we’ll use the &lt;code&gt;createuser&lt;/code&gt; command, which comes with PostgreSQL. As you can see, I’m creating a new user with &lt;code&gt;superuser&lt;/code&gt; privileges (and will hopefully be the last time I have to do a &lt;code&gt;-U postgres&lt;/code&gt;).&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ createuser --superuser robbyrussell -U postgres
  CREATE ROLE    
&lt;/code&gt;&lt;/pre&gt;

Let’s take a quick moment to test this out.
&lt;pre&gt;&lt;code&gt;
  # create a new database
  $ createdb my_test_db
  CREATE DATABASE

  # drop the database
  $ dropdb my_test_db
  DROP DATABASE
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, everything looks good here.&lt;/p&gt;


	&lt;p&gt;We now have a running installation of PostgreSQL with a new user account. All we need to do now is install the appropriate RubyGem to allow our Ruby applications to connect to it.&lt;/p&gt;


	&lt;h4&gt;Installing PostgreSQL Libraries for Ruby&lt;/h4&gt;


	&lt;p&gt;You can install postgres gem by running the following command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$  sudo gem install --include-dependencies postgres&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great. We’ve now built a professional development environment for working with Ruby on Rails. Can you &lt;em&gt;feel&lt;/em&gt; the excitement? :-)&lt;/p&gt;


	&lt;h2&gt;Closing Thoughts&lt;/h2&gt;


	&lt;p&gt;Like the previous versions, I hope that a few people find this useful. I didn&amp;#8217;t have to make a lot of changes from the second edition, but there were enough to warrant a new post. I&amp;#8217;ve been setting up my workstation like this for about three years now and I&amp;#8217;m looking forward to seeing how a fresh install on Leopard works out for me.&lt;/p&gt;


	&lt;p&gt;If you have any problems, feel free to ask a question in the comments below.&lt;/p&gt;</description>
      <pubDate>Tue, 22 Jan 2008 11:55:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:73dcd126-1333-417e-9203-aaefb22a65b1</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>PostgreSQL</category>
      <category>PLANET ARGON</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>postgresql</category>
      <category>xcode</category>
      <category>apple</category>
      <category>osx</category>
      <category>macports</category>
      <category>ruby</category>
      <category>rubygems</category>
      <category>irb</category>
      <category>tutorial</category>
    </item>
    <item>
      <title>ShortURL 0.8.4 released and gets a new mainainer... me!</title>
      <description>&lt;p&gt;Earlier today, Vincent Foley was kind enough to hand over maitenance of the the ShortURL project on RubyForge to me. He first released it back in 2005, which &lt;a href="http://www.robbyonrails.com/articles/2005/06/01/rubyurl-friendly-library"&gt;I blogged about&lt;/a&gt; as &lt;a href="http://rubyurl.com"&gt;RubyURL&lt;/a&gt; was the first shortening service that it supported (and is the default). Unfortunately, the release of RubyURL 2.0 broke backwards compatibility and Vincent wasn&amp;#8217;t maintaining it anymore. So, earlier, I decided to patch this and got a new version released that now works with the current RubyURL site.&lt;/p&gt;


	&lt;p&gt;While working on the code, I decided to extend the compatible services to include &lt;a href="http://moourl.com"&gt;moourl&lt;/a&gt; and &lt;a href="http://urltea.com"&gt;urlTea&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;These updates are available in ShortURL version 0.8.4.&lt;/strong&gt;&lt;/p&gt;


	&lt;h2&gt;Install the ShortURL gem&lt;/h2&gt;


	&lt;p&gt;Installation is a snap&amp;#8230; (like 99.7% of rubygems&amp;#8230;)&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  ~ &amp;gt; sudo gem install shorturl                                                                                                                                                                                                           Password:

  Successfully installed shorturl-0.8.4
  1 gem installed
  Installing ri documentation for shorturl-0.8.4...
  Installing RDoc documentation for shorturl-0.8.4.  
&lt;/code&gt;&lt;/pre&gt;

	&lt;h2&gt;Using ShortURL&lt;/h2&gt;


	&lt;p&gt;The ShortURL gem provides the ShortURL library, which you can use from any Ruby application.&lt;/p&gt;


	&lt;h3&gt;Using the ShortURL library&lt;/h3&gt;


&lt;pre&gt;&lt;code&gt;
  ~ &amp;gt; irb                                                                                                                                                                                                                           
  irb(main):001:0&amp;gt; require 'rubygems'
  =&amp;gt; true
  irb(main):002:0&amp;gt; require 'shorturl'
  =&amp;gt; true
  irb(main):003:0&amp;gt; ShortURL.shorten( 'http://www.istwitterdown.com' )
  =&amp;gt; "http://rubyurl.com/P9w" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;As you can see&amp;#8230;it&amp;#8217;s really straight forward.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s try it with a few other services.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
irb(main):004:0&amp;gt; ShortURL.shorten( 'http://www.istwitterdown.com', :moourl )
=&amp;gt; "http://moourl.com/fvoky" 
irb(main):005:0&amp;gt; ShortURL.shorten( 'http://www.istwitterdown.com', :tinyurl )
=&amp;gt; "http://tinyurl.com/2t3qmh" 
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Using the shorturl command-line tool&lt;/h3&gt;


	&lt;p&gt;Many people don&amp;#8217;t know that ShortURL provides a command-line tool, which you can use after installing the gem.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  ~ &amp;gt; shorturl http://istwitterdown.com                                                                                                                                                                                               
  http://rubyurl.com/Lwk
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;If you&amp;#8217;d like to see more services provided than the ones listed here, please submit &lt;a href="http://rubyforge.org/tracker/?atid=2896&amp;#38;group_id=732&amp;#38;func=browse"&gt;feature requests&lt;/a&gt; and/or &lt;a href="http://rubyforge.org/tracker/?atid=2895&amp;#38;group_id=732&amp;#38;func=browse"&gt;patches&lt;/a&gt; on the rubyforge project.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://rubyforge.org/projects/shorturl/"&gt;http://rubyforge.org/projects/shorturl/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;h2&gt;ShortURL Documentation&lt;/h2&gt;


	&lt;p&gt;To see the latest documentation for the project, please visit:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://rubyforge.org/projects/shorturl/"&gt;http://rubyforge.org/projects/shorturl/&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;My favorite part about this? My &lt;a href="http://www.robbyonrails.com/articles/2005/09/13/rubyurl-meets-rbot"&gt;rbot plugin for RubyURL&lt;/a&gt; works again!&lt;/p&gt;


&lt;div class="thumbnail"&gt;&lt;a href="http://skitch.com/robbyrussell/rpg4/rbot-and-rubyurl"&gt;&lt;img src="http://img.skitch.com/20080107-mhjgi5mqgbcfgygut426ee8b53.preview.jpg" alt="rbot and rubyurl" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-family: Lucida Grande, Trebuchet, sans-serif, Helvetica, Arial; font-size: 10px; color: #808080"&gt;Uploaded with &lt;a href="http://plasq.com/"&gt;plasq&lt;/a&gt;&amp;#8217;s &lt;a href="http://skitch.com"&gt;Skitch&lt;/a&gt;!&lt;/span&gt;&lt;/div&gt;

	&lt;p&gt;Happy &lt;span class="caps"&gt;URL&lt;/span&gt;-shortening!&lt;/p&gt;
</description>
      <pubDate>Sun, 06 Jan 2008 18:49:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:5a4cc022-3fb9-4d4d-9d25-aa709a51c30e</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2008/01/06/shorturl-0-8-4-released-and-gets-a-new-mainainer-me</link>
      <category>RubyURL</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>rubyurl</category>
      <category>shorturl</category>
      <category>rbot</category>
      <category>gem</category>
      <category>rubyforge</category>
      <category>programming</category>
      <category>development</category>
    </item>
    <item>
      <title>PGCon 2008 - Call for Papers</title>
      <description>&lt;p&gt;Are you using &lt;a href="http://postgresql.org"&gt;PostgreSQL&lt;/a&gt; (the world&amp;#8217;s most awesome open-source database server) with &lt;a href="http://rubyonrails.org"&gt;Ruby on Rails&lt;/a&gt;? Do you have any interesting experiences that you might want to share with an audience? Well, you might consider submitting a talk proposal for PGCon 2008, which is taking place in Ottawa, Canada.&lt;/p&gt;


	&lt;p&gt;Details follow&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;PGCon 2008&lt;/h2&gt;


	&lt;p&gt;PGCon 2008 will be held 22-23 May 2008, in Ottawa at the University of
Ottawa.  It will be preceded by two days of tutorials on 20-21 May
2008.&lt;/p&gt;


	&lt;p&gt;We are now requesting proposals for presentations.&lt;/p&gt;


	&lt;p&gt;If you are doing something interesting with PostgreSQL, please submit
a proposal.  You might be one of the backend hackers or work on a
PostgreSQL related project and want to share your know-how with
others. You might be developing an interesting system using
PostgreSQL as the foundation. Perhaps you migrated from another
database to PostgreSQL and would like to share details.  These, and
other stories are welcome. Both users and developers are encouraged
to share their experiences.&lt;/p&gt;


	&lt;p&gt;Here are a few ideas to jump start your proposal process:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;novel, unique or complex ways in which PostgreSQL are used&lt;/li&gt;
		&lt;li&gt;migration of production systems to PostgreSQL&lt;/li&gt;
		&lt;li&gt;data warehousing with PostgreSQL&lt;/li&gt;
		&lt;li&gt;tuning PostgreSQL for different work loads&lt;/li&gt;
		&lt;li&gt;replicating data on top of PostgreSQL&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Both users and developers are encouraged to share their experiences.&lt;/p&gt;


	&lt;p&gt;The schedule is:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;19 Dec 2007 Proposal acceptance begins&lt;/li&gt;
		&lt;li&gt;19 Jan 2008 Proposal acceptance ends&lt;/li&gt;
		&lt;li&gt;19 Feb 2008 Confirmation of accepted proposals&lt;/li&gt;
		&lt;li&gt;19 Apr 2008 Final papers/slides must arrive no later than this date&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;See also &lt;a href="http://www.pgcon.org/2008/papers.php"&gt;http://www.pgcon.org/2008/papers.php&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Instructions for submitting a proposal to PGCon 2008 are available
from: &lt;a href="http://www.pgcon.org/2008/submissions.php"&gt;http://www.pgcon.org/2008/submissions.php&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;This&lt;/p&gt;
</description>
      <pubDate>Fri, 28 Dec 2007 10:58:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:77bc4f6f-b27a-4e11-8298-31a70f57809c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/12/28/pgcon-2008-call-for-papers</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>PostgreSQL</category>
      <category>postgresql</category>
      <category>ruby</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>conference</category>
    </item>
    <item>
      <title>Get to Know a Gem: Rak</title>
      <description>&lt;p&gt;A few months ago, I posted about an article that showed you &lt;a href="http://www.robbyonrails.com/articles/2007/10/06/spice-up-your-terminal-with-colored-grep-pattern-results"&gt;how to colorize your grep search results&lt;/a&gt;. Since then, I&amp;#8217;ve heard people talking about &lt;a href="http://petdance.com/ack/"&gt;ack&lt;/a&gt;, which describes itself as&amp;#8230;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;a tool like grep, aimed at programmers with large trees of heterogeneous source code.&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;It&amp;#8217;s written in Perl, which is fine and dandy&amp;#8230; but before I installed it, I heard that there was a Ruby version named &lt;a href="http://rak.rubyforge.org/"&gt;rak&lt;/a&gt;, which describes itself as&amp;#8230;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;a grep replacement in pure Ruby. It accepts Ruby syntax regular expressions and automatically recurses directories, skipping .svn/, .cvs/, pkg/ and more things you don&amp;#8217;t care about. &amp;#8220;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;Sounds great. Let&amp;#8217;s see what this thing can do.&lt;/p&gt;


	&lt;h2&gt;Installing rak&lt;/h2&gt;


	&lt;p&gt;Daniel Lucraft, the author of rak, was kind enough to package it up as a Rubygem. So, all we have to do is install it via &lt;code&gt;gem install rak&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
   &amp;gt; sudo gem install rak                                                                                                                                                                                                     
  Password:
  Bulk updating Gem source index for: http://gems.rubyforge.org
  Successfully installed rak-0.8.0
  Installing ri documentation for rak-0.8.0...
  Installing RDoc documentation for rak-0.8.0...
  ~ &amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, let&amp;#8217;s move on.&lt;/p&gt;


	&lt;h2&gt;Using rak&lt;/h2&gt;


	&lt;p&gt;Now that it&amp;#8217;s installed, we can use Rak by typing &lt;code&gt;rak&lt;/code&gt; from the command line. You&amp;#8217;d typically want to run this from within the root of your application.&lt;/p&gt;


	&lt;p&gt;For example, basic usage would look like the following.&lt;/p&gt;


&lt;code&gt;$ rak search-pattern&lt;/code&gt;

	&lt;p&gt;In my first test, I ran &lt;code&gt;rak README&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/rak_output_1-20071211-083456.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Immediately, I see a greater advantage to &lt;code&gt;rak&lt;/code&gt; over using &lt;code&gt;grep&lt;/code&gt; and that&amp;#8217;s because it&amp;#8217;s giving me line numbers for free, which takes remembering a few extra options with grep.&lt;/p&gt;


	&lt;p&gt;Like &lt;code&gt;grep&lt;/code&gt;, we can specify a specific path to search with. For example, we use a view helper named &lt;code&gt;link_to_unimplemented&lt;/code&gt; to help us track actions that aren&amp;#8217;t implemented yet. Looking at a current project, I can run &lt;code&gt;rak link_to_unimplemented app/views&lt;/code&gt; and produce the following results.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/terminal__less__160x49-20071211-085748.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m going to keep playing with it, but wanted to help get the word out. If you have any tips on using it, please share them in the comments. :-)&lt;/p&gt;
</description>
      <pubDate>Tue, 11 Dec 2007 11:10:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:ae4ad314-4ef2-4c9d-9388-152a1d7c956c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/12/11/get-to-know-a-gem-rak</link>
      <category>Ruby</category>
      <category>Programming</category>
      <category>gems</category>
      <category>rubyforge</category>
      <category>rak</category>
      <category>grep</category>
      <category>terminal</category>
      <category>unix</category>
      <category>tip</category>
      <category>development</category>
      <category>code</category>
      <category>ruby</category>
    </item>
    <item>
      <title>Master/Slave Databases with Ruby on Rails</title>
      <description>&lt;p&gt;Not terribly long ago, I &lt;a href="http://www.robbyonrails.com/articles/2007/10/05/multiple-database-connections-in-ruby-on-rails"&gt;announced Active Delegate&lt;/a&gt;, which was a really lightweight plugin that I developed to allow models to talk to multiple databases for specific methods. The plugin worked great for really simple situations, like individual models.. but when it came time to test with associations it fell apart. I haven&amp;#8217;t had a chance to work on any updates and knew that it was going to take more work to get it going.&lt;/p&gt;


	&lt;p&gt;Earlier this week, we helped one of our bigger clients launch their new web site&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;. For the deployment, we needed to send all writes to a master database and a reads to slaves (initial deployment is talking to almost 10 slaves spread around the globe!). We needed something to get integrated quickly and decided to ditch Active Delegate for the time being and began looking at the following options.&lt;/p&gt;


	&lt;p&gt;I spoke with Rick Olson&lt;sup&gt;&lt;a href="#fn2"&gt;2&lt;/a&gt;&lt;/sup&gt; and he pointed me to a new plugin that he hasn&amp;#8217;t really released yet. So, I&amp;#8217;m going to do him a favor and announce it for him. Of course&amp;#8230; I got his permission first&amp;#8230; ;-)&lt;/p&gt;


	&lt;h2&gt;Announcing Masochism!&lt;/h2&gt;


	&lt;p&gt;Masochism&lt;sup&gt;&lt;a href="#fn3"&gt;3&lt;/a&gt;&lt;/sup&gt; is a new plugin for Ruby on Rails that allows you to delegate all writes to a master database and reads to a slave database. The configuration process is just a few lines in your environment file and the plugin takes care of the rest.&lt;/p&gt;


	&lt;h3&gt;Installing Masochism&lt;/h3&gt;


	&lt;p&gt;With &lt;a href="http://piston.rubyforge.org/usage.html"&gt;piston&lt;/a&gt;, you can import Masochism with:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ cd vendor/plugins
  $ piston import http://ar-code.svn.engineyard.com/plugins/masochism/
&lt;/code&gt;&lt;/pre&gt;

	&lt;ul&gt;
	&lt;li&gt;To learn more about piston, read &lt;a href="http://www.robbyonrails.com/articles/2007/01/16/every-second-counts-with-a-piston-in-your-trunk"&gt;Every Second Counts with a Piston in your trunk&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;You can also install it with the old-fashioned way:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  $ ./script/plugin install -x http://ar-code.svn.engineyard.com/plugins/masochism/
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Configuring Masochism&lt;/h3&gt;


	&lt;p&gt;The first thing that you&amp;#8217;ll need to do is add another database connection in &lt;code&gt;config/database.yml&lt;/code&gt; for &lt;code&gt;master_database&lt;/code&gt;. By default, Masochism expects you to have a production database, which will be the read-only/slave database. The &lt;code&gt;master_database&lt;/code&gt; will be the connection details for your (you guessed it&amp;#8230;) master database.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
# config/database.yml  
production:
  database: masochism_slave_database
  adapter: postgresql
  host: slavedb1.hostname.tld
  ...

master_database:
  database: masochism_master_database
  adapter: postgresql
  host: masterdb.hostname.tld
  ...
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The idea here is that replication will be handled elsewhere and your application can reap the benefits of talking to the slave database for all of it&amp;#8217;s read-only operations and let the master database(s) spend their time writing data.&lt;/p&gt;


	&lt;p&gt;The next step is to set this up in your environment file. In our scenario, this was &lt;code&gt;config/environments/production.rb&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;

# Add this to config/environments/production.rb
config.after_initialize do 
  ActiveReload::ConnectionProxy.setup!    
end

&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Voila, you should be good to go now. As I mentioned, we&amp;#8217;ve only been using this for this past week and we&amp;#8217;ve had to address a few problems that the initial version of the plugin didn&amp;#8217;t address. One of our developers, &lt;a href="http://andy.delcambre.com/"&gt;Andy Delcambre&lt;/a&gt;, just posted an article to show how we had a problem with &lt;a href="http://andy.delcambre.com/2007/11/15/masochistic-connection-proxy-with-observers"&gt;using ActiveRecord observers and masochism&lt;/a&gt;, which we&amp;#8217;re sending over a patch for now.&lt;/p&gt;


	&lt;p&gt;As we continue to monitor how this solution works, we&amp;#8217;ll report any findings on our blog. In the meantime, I&amp;#8217;d be interested in knowing what you&amp;#8217;re using to solve this problem. :-)&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; &lt;a href="http://contiki.com"&gt;Contiki&lt;/a&gt;, a cool travel company we&amp;#8217;re working with&lt;/p&gt;


	&lt;p id="fn2"&gt;&lt;sup&gt;2&lt;/sup&gt; Rick just moved to Portland&amp;#8230; welcome to stump town!&lt;/p&gt;


	&lt;p id="fn3"&gt;&lt;sup&gt;3&lt;/sup&gt; &lt;a href="http://ar-code.svn.engineyard.com/plugins/masochism/README"&gt;The Masochism plugin &lt;span class="caps"&gt;README&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
</description>
      <pubDate>Thu, 15 Nov 2007 16:02:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:3420b2e3-a80c-43c9-a136-a58040069607</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/11/15/master-slave-databases-with-ruby-on-rails</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>plugins</category>
      <category>masochism</category>
      <category>database</category>
      <category>mysql</category>
      <category>postgresql</category>
      <category>client</category>
      <category>development</category>
      <category>activerecord</category>
      <category>replication</category>
      <category>deployment</category>
    </item>
    <item>
      <title>Using MacPorts Ruby and Rails after Upgrading to OS X Leopard</title>
      <description>&lt;p&gt;If you previously followed my article, &lt;a href="http://www.robbyonrails.com/articles/2007/06/19/installing-ruby-on-rails-and-postgresql-on-os-x-second-edition"&gt;Installing Ruby on Rails and PostgreSQL on &lt;span class="caps"&gt;OS X&lt;/span&gt;, second edition&lt;/a&gt; and are now upgrading to &lt;span class="caps"&gt;OS X&lt;/span&gt; Leopard, you&amp;#8217;ll want to make a few adjustments to your setup.&lt;/p&gt;


	&lt;p&gt;First of all, it&amp;#8217;s great that Apple has decided to provide Ruby on Rails out of the box.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list rails                                                                                                                                                                   
  *** LOCAL GEMS ***

  rails (1.2.3)
      Web-application framework with template engine, control-flow layer,
      and ORM.
&lt;/code&gt;&lt;/pre&gt;

How many gems does it come with?
&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list|grep '^[a-z]'|wc -l                                                                                                                                                     
      29
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;It&amp;#8217;s really great that &lt;a href="http://apple.com"&gt;Apple&lt;/a&gt; shipped Leopard pre-installed with 29 gems, especially if you don&amp;#8217;t have your entire Rails stack setup already. In my case and for those that have followed my installation process, you don&amp;#8217;t need to switch over to this new development stack (yet). I have a lot of time invested in my fully-functionaly MacPorts installation process (PostgreSQL, MySQL, RMagick, Subversion, Git, etc. Since this all working fine on my machine, I&amp;#8217;m not ready to make the switch to Apple&amp;#8217;s installation.&lt;/p&gt;


	&lt;h2&gt;Don&amp;#8217;t Fix it&amp;#8230; if it&amp;#8217;s not broken!&lt;/h2&gt;


	&lt;p&gt;So, the the first thing that I did was modify my &lt;code&gt;PATH&lt;/code&gt; environment variable, which has &lt;code&gt;/usr/bin&lt;/code&gt; as the first path that it&amp;#8217;ll look at when you try to run commands like &lt;code&gt;ruby&lt;/code&gt;, &lt;code&gt;mongrel_rails&lt;/code&gt;, &lt;code&gt;gem&lt;/code&gt;, etc. You&amp;#8217;ll want to modify this and prepend &lt;code&gt;/opt/local/bin:&lt;/code&gt; to the front of &lt;code&gt;PATH&lt;/code&gt; in your shell configuration. If you&amp;#8217;re using bash, this would be&amp;#8230; &lt;code&gt;~/.bashrc&lt;/code&gt;. If you&amp;#8217;re using zshell like me, &lt;code&gt;~/.zshrc&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;Now, when you start a new Terminal and run &lt;code&gt;gem list&lt;/code&gt;, you&amp;#8217;ll see all of the gems that you already have installed.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list rails                                                                                                                                   &amp;lt; new-host

*** LOCAL GEMS ***

rails (1.2.5, 1.2.4, 1.2.3, 1.1.6)
    Web-application framework with template engine, control-flow layer,
    and ORM.
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Back to my happy gems&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
~ &amp;gt; gem list|grep '^[a-z]'|wc -l                                                                                                                                                              &amp;lt; new-host
      72
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great! Now I can get back to work and spend time playing with the new features in Finder, Mail.app, and iChat instead of installing all of the software dependencies that our development projects have. :-)&lt;/p&gt;
</description>
      <pubDate>Sat, 27 Oct 2007 05:43:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4c96e766-87e4-41f4-9d7d-54fe826ed4e9</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/27/using-macports-ruby-and-rails-after-upgrading-to-os-x-leopard</link>
      <category>RubyURL</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>rails</category>
      <category>ruby</category>
      <category>gems</category>
      <category>rubyonrails</category>
      <category>osx</category>
      <category>DRY</category>
      <category>macports</category>
      <category>leopard</category>
      <category>zsh</category>
      <category>bash</category>
      <category>rmagick</category>
    </item>
    <item>
      <title>Chad Fowler's Dirty Little Secret?</title>
      <description>&lt;p&gt;I saw this photo of the Microsoft team from 1978 on &lt;a href="http://flickr.com/photos/anselmhook/1498377919/"&gt;Anselm&amp;#8217;s flickr&lt;/a&gt; and thought, &amp;#8220;Hmm, that looks like Chad Fowler!&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/chad_fowler_in_78-20071006-130251.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Could this be &lt;a href="http://chadfowler.com/"&gt;Chad Fowler&amp;#8217;s&lt;/a&gt; dirty little secret?..&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/imgp5302.png__png_image__413x416_pixels_-20071006-125640.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Happy Saturday!&lt;/p&gt;
</description>
      <pubDate>Sat, 06 Oct 2007 15:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c6f3710c-4bbc-415c-8bb4-17107749a5e0</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/06/chads-dirty-little-secret</link>
      <category>Off-Topic</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>sarcasm</category>
      <category>humor</category>
      <category>chad</category>
      <category>chadfowler</category>
      <category>rubyonrails</category>
      <category>rails</category>
      <category>microsoft</category>
    </item>
    <item>
      <title>Multiple Database Connections in Ruby on Rails</title>
      <description>&lt;p&gt;We have a client that already has some database replication going on in their deployment and needed to have most of their Ruby on Rails application pull from slave servers, but the few writes would go to the master, which would then end up in their slaves.&lt;/p&gt;


	&lt;p&gt;So, I was able to quickly extend ActiveRecord with just &lt;em&gt;two&lt;/em&gt; methods to achieve this. Anyhow, earlier today, someone in #caboose asked if there was any solutions to this and it prompted me to finally package this up into a quick and dirty Rails plugin.&lt;/p&gt;


	&lt;p&gt;Introducing&amp;#8230; &lt;strong&gt;Active Delegate&lt;/strong&gt;!&lt;/p&gt;


	&lt;p&gt;To install, do the following:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
cd vendor/plugins;
piston import http://svn.planetargon.org/rails/plugins/active_delegate
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Next, you&amp;#8217;ll need to create another database entry in your &lt;code&gt;database.yml&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
login: &amp;#38;login
  adapter: postgresql
  host: localhost
  port: 5432

development:
  database: rubyurl_development
  &amp;lt;&amp;lt;: *login

test:
  database: rubyurl_test
  &amp;lt;&amp;lt;: *login

production:
  database: rubyurl_servant
  &amp;lt;&amp;lt;: *login

# NOTICE THE NEXT ENTRY/KEY
master_database:
  database: rubyurl_master
  &amp;lt;&amp;lt;: *login
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;At this point, your Rails application won&amp;#8217;t talk to the &lt;code&gt;master_database&lt;/code&gt;, because nothing is being told to connect to it. So, the current solution with Active Delegate is to create an ActiveRecord model that will act as a connection handler.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/models/master_database.rb
  class MasterDatabase &amp;lt; ActiveRecord::Base
    handles_connection_for :master_database # &amp;lt;-- this matches the key from our database.yml
  end  
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, in the model(s) that we&amp;#8217;ll want to have talk to this database, we&amp;#8217;ll do add the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  # app/models/animal.rb
  class Animal &amp;lt; ActiveRecord::Base
     delegates_connection_to :master_database, :on =&amp;gt; [:create, :save, :destroy]
  end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, when your application performs a &lt;code&gt;create&lt;/code&gt;, &lt;code&gt;save&lt;/code&gt;, or &lt;code&gt;destroy&lt;/code&gt;, it&amp;#8217;ll talk to the master database and your &lt;code&gt;find&lt;/code&gt; calls will retrieve data from your servant database.&lt;/p&gt;


	&lt;p&gt;It&amp;#8217;s late on a Friday afternoon and I felt compelled to toss this up for everyone. I think that this could be improved quite a bit, but it&amp;#8217;s working great for the original problem that needed to be solved.&lt;/p&gt;


	&lt;p&gt;If you have feedback and/or bugs, please &lt;a href="http://planetargon.lighthouseapp.com/projects/5187-open-source-projects/"&gt;send us tickets&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Fri, 05 Oct 2007 17:54:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:69a8625d-e24b-4f4e-aa58-d69a67784698</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/05/multiple-database-connections-in-ruby-on-rails</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>PostgreSQL</category>
      <category>PLANET ARGON</category>
      <category>databases</category>
      <category>replication</category>
      <category>activerecord</category>
      <category>plugins</category>
      <category>planetargon</category>
      <category>code</category>
    </item>
    <item>
      <title>PLANET ARGON is seeking fresh talent... could it be you?</title>
      <description>&lt;p&gt;My blog has been fairly quiet lately because our team has been busy helping push a few big client projects out the door. We&amp;#8217;ll be posting announcements about those launches on the &lt;a href="http://blog.planetargon.com"&gt;&lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt; Blog&lt;/a&gt; soon, so stay-tuned there!&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;ve been growing the design-side of our team lately, but we&amp;#8217;re also still seeking some more Rails-talent in Portland, OR. If you&amp;#8217;re in Portland or interested in moving here&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt;, you should introduce yourself to our team. We&amp;#8217;re looking for people to work on-site in Portland, so any remote candidates will be turned away&amp;#8230; we&amp;#8217;re moving into a shiny and new office space in downtown and are looking for another developer to join our Design and Development team.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/1010617614/" title="Photo Sharing"&gt;&lt;img src="http://farm2.static.flickr.com/1283/1010617614_25191cbcab.jpg" width="333" height="500" alt="PLANET ARGON goes hiking" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;small&gt;you&amp;#8217;ll fit in really well if you&amp;#8217;re into outdoor activities&amp;#8230; ;-)&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;re seeking mid-level Ruby on Rails developers that can pick things up quickly. Having some experience with RSpec will go along way with us. Ideal candidates would have great communication skills and be able to work in a fast-paced environment that places a &lt;em&gt;huge&lt;/em&gt; emphasis on &lt;a href="http://www.robbyonrails.com/articles/2007/05/23/hug-your-designer-day-part-2"&gt;collaboration between designers and developers&lt;/a&gt; (let&amp;#8217;s not forget to mention our clients). Bring what you already know and learn the rest with us.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://farm1.static.flickr.com/123/345862990_d60db3c2ae.jpg" alt="" /&gt;&lt;br /&gt;&lt;small&gt;While everyone might have Wii&amp;#8217;s in the office, we&amp;#8217;ve taken it to the next level with Speed Stacking! :-p&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;To apply, send an email to &lt;a href="mailto:af22+8509@c1.catchthebest.com"&gt;af22+8509@c1.catchthebest.com&lt;/a&gt;,&lt;/p&gt;


	&lt;p&gt;Side note: We&amp;#8217;re giving &lt;a href="http://www.catchthebest.com"&gt;Catch the Best&lt;/a&gt; a whirl to review job candidates. If you&amp;#8217;re hiring people, you might consider giving it a try.&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; Everybody is moving to Portland&amp;#8230; ;-)&lt;/p&gt;
</description>
      <pubDate>Thu, 04 Oct 2007 10:10:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4b3818bc-9ac3-4bb5-80ef-1df68979893c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/10/04/planet-argon-is-seeking-fresh-talent-could-it-be-you</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>hiring</category>
      <category>job</category>
      <category>portland</category>
      <category>oregon</category>
      <category>planetargon</category>
      <category>developer</category>
      <category>rubynrails</category>
      <category>rails</category>
    </item>
    <item>
      <title>Edge Rails Documentation: Revisited</title>
      <description>&lt;p&gt;This question, &lt;em&gt;&amp;#8220;where can I find documentation for Edge Rails?&amp;#8221;&lt;/em&gt; still comes up quite often on mailing lists, &lt;span class="caps"&gt;IRC&lt;/span&gt;, and other places. I just wanted to point out a few resources for you.&lt;/p&gt;


	&lt;p&gt;In March 2006, &lt;a href="http://www.robbyonrails.com/articles/2006/03/03/bleeding-edge-rails-documentation"&gt;our team announced&lt;/a&gt; that we&amp;#8217;d be updating a &lt;span class="caps"&gt;RDOC&lt;/span&gt; site a few times a day as the Rails project gets commits.&lt;/p&gt;


	&lt;p&gt;You can still access the &lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt; Edge Rails documentation here:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://edgedocs.planetargon.org"&gt;http://edgedocs.planetargon.org&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Caboose also has some Edge Rails documentation here:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://caboo.se/doc.html"&gt;http://caboo.se/doc.html&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;If you&amp;#8217;re aware of any other online resources for Edge Rails documentation, please let me know.&lt;/p&gt;
</description>
      <pubDate>Wed, 26 Sep 2007 08:34:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6438d608-93ab-43c9-9fcd-5837529bd67c</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/09/26/edge-rails-documentation-revisited</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>edge</category>
      <category>edgerails</category>
      <category>documentation</category>
    </item>
    <item>
      <title>Rails Business: &amp;quot;Weekly&amp;quot; Review #4</title>
      <description>&lt;p&gt;As I mentioned in my &lt;a href="http://www.robbyonrails.com/articles/2007/08/05/rails-business-weekly-review-3"&gt;last review&lt;/a&gt;, I wouldn&amp;#8217;t be updating on a weekly basis, which is a shame because there are so many fascinating discussions going on that might benefit you if you&amp;#8217;re running a business that uses and/or relies on the Ruby on Rails framework. I&amp;#8217;d like to highlight some of the discussions that have been taking place over the past month or so.&lt;/p&gt;


	&lt;p&gt;First off&amp;#8230; wow!  As of this morning, there are &lt;strong&gt;&lt;a href="http://groups.google.com/group/rails-business/about"&gt;650 members&lt;/a&gt;&lt;/strong&gt;!&lt;/p&gt;


	&lt;h2&gt;Some Recent Discussions&lt;/h2&gt;


	&lt;h3&gt;Obtaining Ruby Gigs&lt;/h3&gt;


	&lt;p&gt;Johan Pretorius started &lt;a href="http://groups.google.com/group/rails-business/browse_thread/thread/d330f8da1ec92f0d/50ac745f31319c9e#50ac745f31319c9e"&gt;a discussion&lt;/a&gt; with the following&amp;#8230;&lt;/p&gt;


	&lt;blockquote&gt;
		&lt;p&gt;&amp;#8220;I&amp;#8217;ve been lurking on the group for a while now, the time has come to participate &amp;#8230; What strategy would you recommend for somebody that wants to break into the Ruby (on Rails) market?&amp;#8221;&lt;/p&gt;
	&lt;/blockquote&gt;


	&lt;p&gt;On a related topic, Jose Hurtado started a discussion asking for tips on &lt;a href="http://groups.google.com/group/rails-business/browse_thread/thread/304ba61debb1c377/01369df836068385#01369df836068385"&gt;how to get a reputation&lt;/a&gt; in the Ruby on Rails community for you business.&lt;/p&gt;


	&lt;p&gt;Some of the responses included:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;Start a portfolio&lt;/li&gt;
		&lt;li&gt;Contribute to Open Source projects&lt;/li&gt;
		&lt;li&gt;Contribute to Rails through Documentation&lt;/li&gt;
		&lt;li&gt;Subcontract through well-known developers&lt;/li&gt;
		&lt;li&gt;Start a blog&lt;/li&gt;
		&lt;li&gt;Write a book&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Read the &lt;a href="http://groups.google.com/group/rails-business/browse_thread/thread/304ba61debb1c377/01369df836068385#01369df836068385"&gt;entire thread&lt;/a&gt; and please share any other ideas that you have on this topic with Johan, Jose, and rest of the list. :-)&lt;/p&gt;


	&lt;h3&gt;Taking a full-time job, what about your freelance clients?&lt;/h3&gt;


	&lt;p&gt;Oren writes, &amp;#8220;I got a full-time job offer as employee (and not on as a contractor). My current client might need some help on the weekends in the next month, so I might still do contract work. Can I keep my corporation (corp S) while working full time?&amp;#8221;&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://groups.google.com/group/rails-business/browse_thread/thread/22a881c69746ae72/43b8b2aef20d0fe5#43b8b2aef20d0fe5"&gt;Read the responses&lt;/a&gt;&lt;/p&gt;


	&lt;h3&gt;Reality Check!&lt;/h3&gt;


	&lt;p&gt;Starting your own business might sound like an amazing thing to do, but it often comes with a lot of consequences and struggles, which I&amp;#8217;m definitely not been immune to.&lt;/p&gt;


	&lt;p&gt;Michael M. writes, &amp;#8221;...added to having to create a company, perform customer support, continue to grow the features, marketing, and the loads of other things I haven&amp;#8217;t thought of yet&amp;#8230;is there any hope that one person can pull this off while still working at my current job ( with hopes of going it alone when I&amp;#8217;m sure it can fly ), and giving time to my family, with very little up front costs.  I&amp;#8217;ve been reading quite a bit about bootstrapping lately, but to really make the time has been very difficult.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;There were &lt;a href="http://groups.google.com/group/rails-business/browse_thread/thread/b2d9da960835f9eb/0ff4349d349bf1c7#0ff4349d349bf1c7"&gt;several thoughtful responses&lt;/a&gt; where well-known members of the Ruby on Rails community, such as Joe O&amp;#8217;Brien Ben Curtis shared through personal experiences.&lt;/p&gt;


	&lt;p&gt;Joe O&amp;#8217;Brien wrote, &amp;#8220;I wanted to mainly chime in on the family part.  Something that has taken a year for me to figure out how to balance.   I would not have been able to do any of it, had it not been for my wife&amp;#8217;s full support.  I have three kids, all of whom I love spending time with, so figuring out a way to balance it all has been very tricky.  Up front though, my wife and I knew this would not be your typical job.  It helped that I used to travel and now do not, but it has still been an
adjustment.&amp;#8221;&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;ve been running your own Rails business, please consider &lt;a href="http://groups.google.com/group/rails-business/browse_thread/thread/b2d9da960835f9eb/0ff4349d349bf1c7#0ff4349d349bf1c7"&gt;responding to this thread&lt;/a&gt; and sharing your experience.&lt;/p&gt;


	&lt;h2&gt;Join the Community&lt;/h2&gt;


	&lt;p&gt;As mentioned, this is just a small sample of some of the great discussions taking place on the Rails Business mailing list. If you&amp;#8217;re an aspiring Rails freelancer or business owner, be sure to &lt;a href="http://groups.google.com/group/rails-business/subscribe"&gt;join the community&lt;/a&gt; and share your experiences and learn from other members of the community that are willing to share theirs.&lt;/p&gt;


	&lt;p&gt;As always, have fun!&lt;/p&gt;
</description>
      <pubDate>Tue, 25 Sep 2007 08:59:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:adadf1da-dc8c-47e2-b71e-b1c008328923</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/09/25/rails-business-weekly-review-4</link>
      <category>Business</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>business</category>
      <category>rails</category>
      <category>rubynrails</category>
      <category>group</category>
      <category>community</category>
    </item>
    <item>
      <title>Rails Development Performance Tip - dev_mode_performance_fixes</title>
      <description>&lt;p&gt;When you&amp;#8217;re running a Rails application in development mode, you might notice that it takes a little longer for requests to get processed and this is somewhat intentional as the framework is was designed to allow you to run the application and make live changes to it. This way you can do some basic functional tests from your web browser, work on &lt;span class="caps"&gt;HTML&lt;/span&gt;/CSS changes, or anything else that might need to be done in development mode.&lt;/p&gt;


	&lt;p&gt;Anyhow, this can be slow from time to time and if you&amp;#8217;ve done much Ajax work, you might be familiar with how slow this can feel when performing some basic tasks. Well, thanks to &lt;a href="http://www.workingwithrails.com/person/5337-josh-goebel"&gt;Josh Goebel&lt;/a&gt;, we can speed up things with a new plugin he just released.&lt;/p&gt;


	&lt;p&gt;To install via piston:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;cd vendor/plugins; piston import http://svn.techno-weenie.net/projects/plugins/dev_mode_performance_fixes/&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;To install via &lt;code&gt;script/plugin&lt;/code&gt;:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;./script/plugin install http://svn.techno-weenie.net/projects/plugins/dev_mode_performance_fixes/&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Josh has posted some &lt;a href="http://svn.techno-weenie.net/projects/plugins/dev_mode_performance_fixes/BENCHMARKS"&gt;benchmarks&lt;/a&gt; and in my totally basic tests&amp;#8230; shows &lt;strong&gt;about four times (4x) speed improvement for reqs/sec&lt;/strong&gt;!&lt;/p&gt;


	&lt;p&gt;How does it work? From what I can tell, it works somewhat like &lt;a href="http://www.zenspider.com/ZSS/Products/ZenTest/#rsn"&gt;autotest&lt;/a&gt;, in that keeps things cached and when it sees files modified, it re-caches the changes. He&amp;#8217;s made it so that the stack doesn&amp;#8217;t need to reload for each request, which is quite slow.&lt;/p&gt;


	&lt;p&gt;Since it&amp;#8217;s development-mode only, I&amp;#8217;d encourage you to install it and give it a whirl.&lt;/p&gt;


	&lt;p&gt;Have Fun!&lt;/p&gt;
</description>
      <pubDate>Tue, 28 Aug 2007 21:57:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3886af4d-eb92-42ae-b5db-5b7f7f32fe34</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/28/rails-development-performance-tip-dev_mode_performance_fixes</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>ruby</category>
      <category>performance</category>
      <category>development</category>
    </item>
    <item>
      <title>Subscribe to Basecamp RSS Feeds in Google Reader</title>
      <description>&lt;p&gt;Yesterday afternoon, we were helping our newest employee, Paige Saez, get setup with new accounts across all of our applications. She uses &lt;a href="http://google.com/reader"&gt;Google Reader&lt;/a&gt; and couldn&amp;#8217;t understand why her Basecamp &lt;span class="caps"&gt;RSS&lt;/span&gt; wasn&amp;#8217;t working in it. We explained that Google doesn&amp;#8217;t provide any way to subscribe to authenticated feeds (yet)... so it wasn&amp;#8217;t something she could do. (I still use NetNewsWire because of this problem&amp;#8230;)&lt;/p&gt;


	&lt;p&gt;During the discussion, I said that it probably wouldn&amp;#8217;t take much effort to build a proxy for an authenticated feed&amp;#8230; and Andy said he&amp;#8217;d give it a shot.&lt;/p&gt;


	&lt;p&gt;10 minutes later&amp;#8230; he had &lt;a href="http://andy.delcambre.com/2007/8/17/authenticated-rss-proxy"&gt;an initial version of a &lt;span class="caps"&gt;RSS&lt;/span&gt; proxy application&lt;/a&gt;, written in Ruby.&lt;/p&gt;


	&lt;p&gt;15 minutes after that, we had it up and running on a private server for all of us at &lt;a href="http://planetargon.com"&gt;&lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt;&lt;/a&gt; to begin using.&lt;/p&gt;


	&lt;p&gt;...and here is the proof!&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/basecamp_google_reader-20070817-133108.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Wee! Authenticated Basecamp &lt;span class="caps"&gt;RSS&lt;/span&gt; feeds in Google reader. It even works with the openid authentication.&lt;/p&gt;


	&lt;p&gt;You can &lt;a href="http://andy.delcambre.com/2007/8/17/authenticated-rss-proxy"&gt;grab the code from Andy&amp;#8217;s blog post&lt;/a&gt; and finally make the switch off of desktop &lt;span class="caps"&gt;RSS&lt;/span&gt; readers to Google Reader, because you know you want to. ;-)&lt;/p&gt;


	&lt;p&gt;Thanks Andy!&lt;/p&gt;
</description>
      <pubDate>Fri, 17 Aug 2007 15:42:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:027be2ac-f2fa-4ad5-83d8-329ab333c3d6</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/17/subscribe-to-basecamp-rss-feeds-in-google-reader</link>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>basecamp</category>
      <category>rss</category>
      <category>mongrel</category>
      <category>google</category>
      <category>reader</category>
      <category>subscription</category>
      <category>authentication</category>
    </item>
    <item>
      <title>RubyURL: new design and code base</title>
      <description>&lt;p&gt;Yesterday evening, I deployed the new version of &lt;a href="http://rubyurl.com"&gt;RubyURL&lt;/a&gt;. This was a collaborative effort between &lt;a href="http://chriszgriffin.com/"&gt;Chris Griffin&lt;/a&gt; and I, which we&amp;#8217;re happy to finally push live.&lt;/p&gt;


	&lt;p&gt;There are a few things that we&amp;#8217;re going to push out in near future, such as an &lt;span class="caps"&gt;API&lt;/span&gt; and a new RubyGem.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://www.flickr.com/photos/robbyrussell/1051199668/" title="Photo Sharing"&gt;&lt;img src="http://farm2.static.flickr.com/1331/1051199668_84a2781b5e.jpg" width="500" height="458" alt="RubyURL » Keep it short (and sweet)" /&gt;&lt;/a&gt;&lt;/p&gt;


	&lt;p&gt;Chris volunteered to work on the new design and I did most of the programming in Ruby on Rails. When we worked on this, we really wanted to keep the process as simple as possible, despite &lt;a href="http://www.robbyonrails.com/articles/2007/07/16/rubyurl-2-0-on-the-horizon"&gt;some of the problems&lt;/a&gt; that the site has been having.&lt;/p&gt;


	&lt;p&gt;In the end, we have a Rails application that is only 85 lines of code and has a 1:2.3 code-to-spec ratio. I wanted to keep it under 100 lines of code. This means that there is some breathing room for further development.&lt;/p&gt;


	&lt;p&gt;We also tried out a beta account that I was given for &lt;a href="http://roundhaus.com/"&gt;RoundHaus&lt;/a&gt; for Subversion hosting. We had a really good experience using their service and were impressed by the plethora of useful features that came with the repository, such as continuous integration, rcov/code coverage stats, and twitter integration!.&lt;/p&gt;


	&lt;p&gt;If you find a bug, be sure to submit a ticket on the &lt;a href="http://planetargon.lighthouseapp.com/projects/4059-rubyurl/"&gt;RubyURL bug tracker&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;On a side note, we deployed this on a brand new &lt;a href="http://railsboxcar.com"&gt;Rails Boxcar&lt;/a&gt;, our new hosting solution that will be launched in the very near future. ;-)&lt;/p&gt;
</description>
      <pubDate>Wed, 08 Aug 2007 08:58:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:9306d9e7-32b5-4afc-ba15-46cc3bc8590a</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/08/rubyurl-new-design-and-code-base</link>
      <category>RubyURL</category>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>PLANET ARGON</category>
      <category>rubyurl</category>
      <category>design</category>
      <category>development</category>
      <category>launch</category>
      <category>boxcar</category>
      <category>rubyonrails</category>
      <category>rails</category>
    </item>
    <item>
      <title>Spec Your Views</title>
      <description>&lt;p&gt;I meant to work on this post&amp;#8230; oh about 7 months ago.&lt;/p&gt;


	&lt;p&gt;Way back in January (7 months ago), Jamis Buck posted an article titled, &lt;a href="http://weblog.jamisbuck.org/2007/1/29/testing-your-views"&gt;Testing your views&lt;/a&gt;, which gave a few tips on using Test::Unit to, as the title suggests, test your views.&lt;/p&gt;


	&lt;p&gt;While, I&amp;#8217;m not going to rewrite everything that Jamis wrote, I&amp;#8217;d like to show you how to test these views with RSpec. (you might take a moment to quickly read his post&amp;#8230;)&lt;/p&gt;


	&lt;p&gt;In this example, I&amp;#8217;m going to show you how we&amp;#8217;re able to write specs for the following &lt;span class="caps"&gt;RHTML&lt;/span&gt;, which  you&amp;#8217;ll notice matches the code that he wrote tests for.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
  &amp;lt;% if @user.administrator? %&amp;gt;
    Hi &amp;lt;%= @user.name %&amp;gt;! You appear to be an administrator.
    &amp;lt;%= link_to "Click here", admin_url, :id =&amp;gt; "admin_link" %&amp;gt;
    to see the admin stuff!
  &amp;lt;% end %&amp;gt; 
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Jamis writes, &lt;em&gt;&amp;#8220;The only really significant thing you ought to be testing here is that the admin link only shows up for administrators. &amp;#8220;&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;So, let&amp;#8217;s do just that, but with RSpec.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m not sure how Jamis is handling his view tests, but we&amp;#8217;re going to approach our view specs, much like we approach our controller specs, with the use of mocks and stubs, because we really don&amp;#8217;t need to spec any of our models at this level in the application.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;Tip:&lt;/strong&gt; Write specifications for your models&amp;#8230; in your model specs &lt;strong&gt;not&lt;/strong&gt; in your controller or view specs.&lt;/p&gt;


	&lt;p&gt;The first thing that we&amp;#8217;re going to do is setup a custom spec helper, because for something like an mocked user, will probably get reused in other areas of the user interface. Spec helpers are essentially modules that you can include in your RSpec descriptions (the block that starts with &lt;code&gt;describe&lt;/code&gt;) and reuse.&lt;/p&gt;


	&lt;p&gt;In this spec helper, I&amp;#8217;m going to include two methods, to mock the User model and stub out any of the methods that are necessary for spec&amp;#8217;n this view.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
module MockUserHelper
  def mock_normal_user
    user = mock(User)
    user.stub!(:administrator?).and_return(false)   # &amp;lt;--- NOT an admin
    user.stub!(:name).and_return('David Chelimsky')
    return user
  end

  def mock_admin_user
    user = mock(User)
    user.stub!(:administrator?).and_return(true)    # &amp;lt;--- IS an admin
    user.stub!(:name).and_return('Aslak Hellesoy')
    return user
  end
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;In the &lt;code&gt;mock_normal_user&lt;/code&gt; method, we&amp;#8217;re constructing a mock object and stubbing out the methods that we see are being called in the &lt;span class="caps"&gt;RHTML&lt;/span&gt; code. In &lt;code&gt;mock_admin_user&lt;/code&gt;, we&amp;#8217;re basically doing the same thing, but just stubbing the &lt;code&gt;administrator?&lt;/code&gt; method to return &lt;code&gt;true&lt;/code&gt; for this mock user.&lt;/p&gt;


	&lt;p&gt;By stubbing these methods, we&amp;#8217;ll be able to send a non-ActiveRecord object to the view and have it render without knowing the difference. For example, the &lt;code&gt;if @user.administrator?&lt;/code&gt; condition will return true or false, depending on how we stubbed it.&lt;/p&gt;


	&lt;p&gt;For more information on mocks and stubs, &lt;a href="http://rspec.rubyforge.org/documentation/mocks/index.html"&gt;read here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;Now that we have our spec helper, let&amp;#8217;s go ahead and dive into a few specifications for the view.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
describe "index page" do
  include MockUserHelper

  it "should render an admin link for an admin user" do
    assigns[:user] = mock_admin_user
    render 'index'
    response.should have_tag('a#admin_link')
  end

  it "should not render an admin link for a normal, non-admin user" do
    assigns[:user] = mock_normal_user
    render 'index'
    response.should_not have_tag('a#admin_link')
  end
end  
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;strong&gt;Please note:&lt;/strong&gt; This code example is only longer than the one shown by Jamis because he didn&amp;#8217;t include how he setup all his user sessions/objects. ;-)&lt;/p&gt;


	&lt;p&gt;When these specs are run, we can see the following results.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/rspec_results-20070801-233809.jpg" alt="" /&gt;&lt;br /&gt;&lt;small&gt;Pretty output courtesy of RSpec + TextMate bundle&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;Great, we&amp;#8217;ve been able to write specifications for our Rails views without a lot of pain. Stay tuned for more posts on this topic as I continue writing about how Designers and Developers can work together, in harmony. (&lt;a href="http://www.robbyonrails.com/articles/2007/08/01/designers-developers-and-the-x_-factor"&gt;see my last post on this topic&lt;/a&gt;)&lt;/p&gt;


	&lt;p&gt;For more information on adopting RSpec, please visit the &lt;a href="http://rspec.rubyforge.org"&gt;RSpec project homepage&lt;/a&gt;.&lt;/p&gt;
</description>
      <pubDate>Thu, 02 Aug 2007 02:00:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:c21e25cf-1a4a-4b9f-a628-89fc00945829</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/08/02/spec-your-views</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>rails</category>
      <category>rubyonrails</category>
      <category>testing</category>
      <category>driven</category>
      <category>bdd</category>
      <category>rspec</category>
      <category>behavior</category>
      <category>mocks</category>
      <category>designers</category>
      <category>rhtml</category>
      <category>html</category>
      <category>specs</category>
    </item>
    <item>
      <title>YSlow and Rails performance: Getting UJS and AssetPackager to play nice  </title>
      <description>&lt;p&gt;Yesterday, I started to dig deeper into &lt;a href="http://developer.yahoo.com/yslow/"&gt;YSlow&lt;/a&gt; and decided to pick an application that we recently launched for a client. The performance grade that I saw at first was an F, which wasn&amp;#8217;t surprising to me because we knew that there was going to be some fine tuning in the near future.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/30elm___assets-20070727-100946.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;There is a lot of JavaScript in this application and we have several files to break up stuff to make it more maintainable. However, in production, we really don&amp;#8217;t need to send the client (browser) 19 different JS files. We&amp;#8217;ve been using mod_deflate to compress these files, but it doesn&amp;#8217;t solve the problem of having several connections opening to download all the necessary JavaScript. The same is true for our &lt;span class="caps"&gt;CSS&lt;/span&gt; files.&lt;/p&gt;


	&lt;p&gt;At RailsConf, &lt;span class="caps"&gt;DHH&lt;/span&gt; announced that an upcoming version of Rails would bundle all the stylesheet and javascript files into one file and compress it. We&amp;#8217;re running on 1.2.x for this application and decided to look at the &lt;a href="http://synthesis.sbecker.net/pages/asset_packager"&gt;AssetPackager plugin&lt;/a&gt; as a good solution to this problem.&lt;/p&gt;


	&lt;p&gt;I installed the plugin via &lt;a href="http://piston.rubyforge.org/"&gt;piston&lt;/a&gt; and ran the following task, which is provided by AssetPackager.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;rake asset:packager:create_yml&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This went ahead and created &lt;code&gt;config/assets_packager.yml&lt;/code&gt;. I then went ahead and updated our capistrano configuration to call the rake task after updating the code on the server when deploying.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
desc "all of our other tasks/commands to run after updating the code" 
task :after_update_code do
  #
  # all of our other tasks/commands
  #
  run "cd #{release_path} &amp;#38;&amp;#38; rake RAILS_ENV=production asset:packager:build_all" 
end
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;The first thing that I noticed was that the yml file that gets generated will not make any assumption as to what order the javascript libraries should be loaded. So, immediately, line 1 of our compressed javascript file was causing an error as the code was trying to reference a library that hadn&amp;#8217;t been defined yet (showed up later in the file). So, when you do this, you&amp;#8217;ll need to organize the yml file to load things in order that they are needed. This was also a good opportunity for us to say, &amp;#8220;oh, we&amp;#8217;re not using that one anymore. Let&amp;#8217;s remove it.&amp;#8221;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
--- 
javascripts: 
- base: 
  - prototype  
  - effects
  - scriptaculous
  - controls
  - dragdrop
  - application
  - slider
  - pngfix
  - nav
  - lowpro
  - lightbox
  - folder
  - builder
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, so we re-dployed and everything at first glance seemed fine&amp;#8230; &lt;em&gt;or so we thought!&lt;/em&gt;&lt;/p&gt;


	&lt;p&gt;We used the &lt;a href="http://www.ujs4rails.com/"&gt;unobtrusive javascript plugin&lt;/a&gt; for this project and it seems that we couldn&amp;#8217;t just compress every single file. Each page has a behaviors javascript file and since everything was being compressed into one file (and cached), &lt;span class="caps"&gt;RJS&lt;/span&gt; calls quickly broke throughout the site. &lt;strong&gt;&lt;span class="caps"&gt;OH NO&lt;/span&gt;!&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;So, I opted to merge all of the other javascript files and use the standard way of including unobtrusive javascript in the application layout.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
&amp;lt;%= javascript_include_merged :base %&amp;gt;
&amp;lt;%= javascript_include_tag :unobtrusive %&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;We also removed &lt;code&gt;lowpro&lt;/code&gt; from the list of javascript files to compress since the ujs plugin is currently including this when we call &lt;code&gt;&amp;lt;%= javascript_include_tag :unobtrusive %&amp;gt;&lt;/code&gt;. I plan to look into modifying this so we it&amp;#8217;ll only include the page-specific behaviors and not load the lowpro javascript file (so we can compress that as well).&lt;/p&gt;


	&lt;p&gt;Once this was re-deployed, we saw that the &lt;span class="caps"&gt;RJS&lt;/span&gt; issues were resolved and everything felt to be loading quicker. But, let&amp;#8217;s look at YSlow again for step 1 in improving the performance of the application.&lt;/p&gt;


	&lt;p&gt;&lt;strong&gt;side note:&lt;/strong&gt; the following grading was also after making some other adjustments that were suggested by YSlow, which I&amp;#8217;ll discuss in another blog post soon.&lt;/p&gt;


	&lt;p&gt;So, where we once had a grade F, we now have an D&amp;#8230; which is due to the client having us add several (four) external javascript files for mint, google analytics, etc. We&amp;#8217;re only loading 3 javascript files for the application, when we were originally loading many more.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://myskitch.com/robbyrussell/30elm___your_address_for_home_design-20070727-114427.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Obviously, there is some more tuning to be done, but we went from a grading of 43 to 74 in about three hours of time spent reading the YSlow documentation, adding asset_packager, and making various tweaks to our web servers (as suggested by YSlow).&lt;/p&gt;


	&lt;p&gt;Until next time&amp;#8230;&lt;/p&gt;


	&lt;p&gt;Related Posts:&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://www.robbyonrails.com/articles/2007/01/16/every-second-counts-with-a-piston-in-your-trunk"&gt;Every Second Counts with a Piston in your Trunk&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;
</description>
      <pubDate>Fri, 27 Jul 2007 13:40:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:e47a0bfa-0fff-42da-90a6-0c95701cdcc3</guid>
      <author>Robby Russell</author>
      <link>http://www.robbyonrails.com/articles/2007/07/27/yslow-and-rails-performance-getting-ujs-and-assetpackager-to-play-nice</link>
      <category>Ruby on Rails</category>
      <category>Ruby</category>
      <category>Programming</category>
      <category>assets</category>
      <category>javascript</category>
      <category>rails</category>
      <category>performance</category>
      <category>yslow</category>
      <category>rubyonrails</category>
      <category>deployment</category>
      <category>capistrano</category>
      <category>compression</category>
      <category>hosting</category>
    </item>
    <item>
      <title>Installing Ruby on Rails and PostgreSQL on OS X, Second Edition</title>
      <description>&lt;p&gt;It&amp;#8217;s been just over a year since I posted the article, &lt;a href="http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx"&gt;Install Ruby, Rails, and PostgreSQL on &lt;span class="caps"&gt;OSX&lt;/span&gt;&lt;/a&gt; and it still gets quite a bit of traffic. Unfortunately, there have been a few changes in the install process that have caught people.&lt;/p&gt;


	&lt;p&gt;Today, I am leaving my PowerBook G4. It&amp;#8217;s being replaced with a MacBook because the logic board is on the fritz. So, guess what that means? I get to install Ruby, Ruby on Rails, PostgreSQL on &lt;span class="caps"&gt;OS X&lt;/span&gt; again! I figured that I would post a revised version of my previous article for those who may go through this same process in the near future.&lt;/p&gt;


&lt;div class="warning"&gt;
&lt;strong&gt;&lt;span class="caps"&gt;&lt;span class="caps"&gt;WARNING&lt;/span&gt;&lt;/span&gt;:&lt;/strong&gt; This post contains some outdated instructions. Please read &lt;a href="http://www.robbyonrails.com/articles/2008/01/22/installing-ruby-on-rails-and-postgresql-on-os-x-third-edition"&gt; Installing Ruby on Rails and PostgreSQL on &lt;span class="caps"&gt;&lt;span class="caps"&gt;OS X&lt;/span&gt;&lt;/span&gt;, Third Edition&lt;/a&gt;, which is focused on Installing Ruby on Rails on Leopard.
&lt;/div&gt;
&lt;h2&gt;Step Zero: Install iTerm (optional)&lt;/h2&gt;


	&lt;p&gt;You&amp;#8217;ll spend a lot of time in your terminal as a Rails developer. I&amp;#8217;m not a big fan of Terminal.app as it lacks tabbed windows&lt;sup&gt;&lt;a href="#fn1"&gt;1&lt;/a&gt;&lt;/sup&gt; and you&amp;#8217;ll often find me with around ten tabs open. I&amp;#8217;ve been using &lt;a href="http://iterm.sourceforge.net/"&gt;iTerm&lt;/a&gt; for a few years and it&amp;#8217;s definitely improved in the past year and doesn&amp;#8217;t seem to crash nearly as often as it used to.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://iterm.sourceforge.net/download.shtml"&gt;Download the latest iTerm release&lt;/a&gt;&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Once installed, I always change the default color scheme as I prefer the white on black schema. The menus in iTerm are lacking some thoughtful interaction design, but I&amp;#8217;ve figured out the right way to do it (after a long time of stumbling on it by accident). In iTerm, you&amp;#8217;ll want to &lt;strong&gt;edit&lt;/strong&gt; the Default bookmark, which you can access by going to Manage Bookmarks under the Bookmarks Menu.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.robbyonrails.com/files/ror_osx_iterm_bookmark.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Set the &lt;strong&gt;Display&lt;/strong&gt; value to &lt;strong&gt;classic iTerm&lt;/strong&gt; and you&amp;#8217;re golden.&lt;/p&gt;


	&lt;p&gt;Now&amp;#8230; let&amp;#8217;s get to business&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;Step 1: Install Xcode Tools&lt;/h2&gt;


	&lt;p&gt;Without installing Xcode tools from Apple, we&amp;#8217;re not going to get very far. First, you&amp;#8217;ll need to grab a copy of Xcode, which you can download on Apple&amp;#8217;s Developer Connection site. It&amp;#8217;s almost a 1GB download, so you&amp;#8217;ll want to start your download and use your multi-tasking skills and &lt;a href="http://drinkviso.com/"&gt;grab a Viso&lt;/a&gt;, read some &lt;a href="http://www.planetrubyonrails.org"&gt;blog&lt;/a&gt; &lt;a href="http://therailsway.com/"&gt;posts&lt;/a&gt;.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://developer.apple.com/tools/download/"&gt;Download Xcode&lt;/a&gt; (dmg)&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;I&amp;#8217;m going to make the assumption here that you know how to install a dmg on osx. Once this is installed, you can move on to the next step!&lt;/p&gt;


	&lt;h2&gt;Step 2: All Your MacPorts are Belong to Us&lt;/h2&gt;


	&lt;p&gt;&lt;a href="http://www.macports.org/"&gt;MacPorts&lt;/a&gt; (formerly known as DarwinPorts) is a package management system for &lt;span class="caps"&gt;OS X&lt;/span&gt;. This is what we&amp;#8217;ll use to install most of the necessary programs to develop and run your Ruby on Rails applications. If you&amp;#8217;re from the Linux or &lt;span class="caps"&gt;BSD&lt;/span&gt; world, you are likely familiar with similar tools&amp;#8230; such as: &lt;code&gt;apt-get&lt;/code&gt;, &lt;code&gt;port&lt;/code&gt;, and &lt;code&gt;yum&lt;/code&gt;.&lt;/p&gt;


	&lt;p&gt;You&amp;#8217;ll want to download MacPorts and install the dmg file.&lt;/p&gt;


	&lt;p&gt;&lt;img src="http://www.robbyonrails.com/files/ror_osx_macports.jpg" alt="" /&gt;&lt;/p&gt;


	&lt;p&gt;Now that this is installed, we should test it.&lt;/p&gt;


	&lt;p&gt;With a new terminal, run the following:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ port version
Version: 1.442
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Success! Let&amp;#8217;s get going&amp;#8230;&lt;/p&gt;


	&lt;h2&gt;Step 3: Installing the Ruby on Rails development stack&lt;/h2&gt;


	&lt;p&gt;We&amp;#8217;re going to go through a series of small steps, which may take some time depending on how fast your internet connection and computer is.&lt;/p&gt;


	&lt;h3&gt;Install Ruby and RubyGems&lt;/h3&gt;


	&lt;p&gt;In order to install Ruby, we&amp;#8217;re going to use MacPorts with the &lt;code&gt;port&lt;/code&gt; command, which is now available for installing various packages on our &lt;span class="caps"&gt;OS X&lt;/span&gt; machines.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo port install ruby rb-rubygems&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;It&amp;#8217;ll probably take a while to download and install Ruby and all of it&amp;#8217;s known dependencies. In the meantime, check out &lt;a href="http://lolcode.com/"&gt;some funny code&lt;/a&gt;. &lt;span class="caps"&gt;KTHXBYE&lt;/span&gt;!&lt;/p&gt;


	&lt;p&gt;Still waiting for it to install, perhaps you could do something like&amp;#8230; begin writing a comment on this post, writing your own blog post, &lt;a href="http://www.youtube.com/watch?v=sLD0SNCFtyA"&gt;watch a funny video&lt;/a&gt;, or &lt;a href="http://workingwithrails.com/recommendation/new/person/5408-robby-russell"&gt;recommend me&lt;/a&gt;. I walked to &lt;a href="http://www.backspace.bz/"&gt;Backspace&lt;/a&gt; with Gary to get an Americano&amp;#8230; and it&amp;#8217;s still not done. :-p&lt;/p&gt;


	&lt;p&gt;(minutes/hours/weeks later)&lt;/p&gt;


	&lt;p&gt;Okay&amp;#8230; I trust that it finished installing Ruby and RubyGems without any hiccups. Let&amp;#8217;s test them from our terminal to make sure.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s check the version&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ ruby -v
ruby 1.8.6 (2007-03-13 patchlevel 0) [i686-darwin8.9.1]
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Now, let&amp;#8217;s make sure that Ruby is working properly&amp;#8230;&lt;/p&gt;


&lt;code&gt;&lt;pre&gt;
$ irb
irb(main):001:0&amp;gt; x = 1     
=&amp;gt; 1
irb(main):002:0&amp;gt; puts "wee!!!" if x == 1
wee!!!
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, we&amp;#8217;re on a roll. Let&amp;#8217;s get the rest of the stack installed.&lt;/p&gt;


	&lt;h3&gt;Install Ruby on Rails&lt;/h3&gt;


	&lt;p&gt;We&amp;#8217;re going to install Ruby on Rails with the &lt;code&gt;gem&lt;/code&gt; command that installing RubyGems provided.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install -y rails
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;This command should produce an output similar to the following.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
Successfully installed rails-1.2.3
Successfully installed rake-0.7.3
Successfully installed activesupport-1.4.2
Successfully installed activerecord-1.15.3
Successfully installed actionpack-1.13.3
Successfully installed actionmailer-1.3.3
Successfully installed actionwebservice-1.2.3
Installing ri documentation for rake-0.7.3...
Installing ri documentation for activesupport-1.4.2...
Installing ri documentation for activerecord-1.15.3...
Installing ri documentation for actionpack-1.13.3...
Installing ri documentation for actionmailer-1.3.3...
Installing ri documentation for actionwebservice-1.2.3...
Installing RDoc documentation for rake-0.7.3...
Installing RDoc documentation for activesupport-1.4.2...
Installing RDoc documentation for activerecord-1.15.3...
Installing RDoc documentation for actionpack-1.13.3...
Installing RDoc documentation for actionmailer-1.3.3...
Installing RDoc documentation for actionwebservice-1.2.3...    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h3&gt;Install Rails-friendly gems&lt;/h3&gt;


	&lt;p&gt;&lt;strong&gt;Mongrel&lt;/strong&gt;&lt;/p&gt;


	&lt;p&gt;If you&amp;#8217;re developing with Rails, it&amp;#8217;s highly recommended that you use install and use &lt;a href="http://mongrel.rubyforge.org"&gt;Mongrel&lt;/a&gt; for your development and production environments. The following command will install the mongrel and mongrel_cluster gems (including their dependencies).&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo gem install -y mongrel mongrel_cluster&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;&lt;small&gt;* Note: Be sure to select the proper platform for mongrel. (hint: &lt;span class="caps"&gt;OS X&lt;/span&gt; is &lt;span class="caps"&gt;NOT&lt;/span&gt; mswin32)&lt;/small&gt;&lt;/p&gt;


	&lt;p&gt;My terminal output:&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install -y mongrel mongrel_cluster
Password:
Bulk updating Gem source index for: http://gems.rubyforge.org
Select which gem to install for your platform (i686-darwin8.9.1)
 1. mongrel 1.0.1 (mswin32)
 2. mongrel 1.0.1 (ruby)
 3. mongrel 1.0 (mswin32)
 4. mongrel 1.0 (ruby)
 5. Skip this gem
 6. Cancel installation
&amp;gt; 2
Select which gem to install for your platform (i686-darwin8.9.1)
 1. fastthread 1.0 (ruby)
 2. fastthread 1.0 (mswin32)
 3. fastthread 0.6.4.1 (mswin32)
 4. fastthread 0.6.4.1 (ruby)
 5. Skip this gem
 6. Cancel installation
&amp;gt; 1
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
Successfully installed mongrel-1.0.1
Successfully installed daemons-1.0.6
Successfully installed fastthread-1.0
Successfully installed gem_plugin-0.2.2
Successfully installed cgi_multipart_eof_fix-2.1
Installing ri documentation for mongrel-1.0.1...
Installing ri documentation for daemons-1.0.6...
Installing ri documentation for gem_plugin-0.2.2...
Installing ri documentation for cgi_multipart_eof_fix-2.1...
Installing RDoc documentation for mongrel-1.0.1...
Installing RDoc documentation for daemons-1.0.6...
Installing RDoc documentation for gem_plugin-0.2.2...
Installing RDoc documentation for cgi_multipart_eof_fix-2.1...
Successfully installed mongrel_cluster-0.2.1    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h2&gt;Step 4: Installing the World&amp;#8217;s Most Advanced Database Server&amp;#8230; PostgreSQL!&lt;/h2&gt;


	&lt;p&gt;At &lt;a href="http://planetargon.com"&gt;&lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt;&lt;/a&gt;, we develop our applications on top of &lt;a href="http://postgresql.or"&gt;PostgreSQL&lt;/a&gt;. I&amp;#8217;ve long been advocating the adoption of this &lt;em&gt;awesome&lt;/em&gt; open source database in the Rails community. Just over a year ago, &lt;a href="http://jvoorhis.com"&gt;Jeremy Voorhis&lt;/a&gt; (PLANET &lt;span class="caps"&gt;ARGON&lt;/span&gt; alumnus) and I were &lt;a href="http://odeo.com/audio/1069086/view"&gt;interviewed on the Ruby on Rails podcast&lt;/a&gt; and had the opportunity to discuss our preference of PostgreSQL over the alternatives (mysql, sqlite, firebird, etc.).&lt;/p&gt;


	&lt;p&gt;We&amp;#8217;re going to install &lt;a href="http://www.postgresql.org/docs/8.2/static/release-8-2.html"&gt;PostgreSQL 8.2&lt;/a&gt; from MacPorts by running the following command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo port install postgresql82 postgresql82-server&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;While this is installing, you might take a moment to check out &lt;a href="http://whytheluckystiff.net/comics/differentSpaceShuttles.html"&gt;some space shuttles&lt;/a&gt;.&lt;/p&gt;


	&lt;h3&gt;Setting up PostgreSQL&lt;/h3&gt;


	&lt;p&gt;You may have noticed the output of the previous port installation of PostgreSQL 8.2, suggested that you do the following. Let&amp;#8217;s do that now&amp;#8230;&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo mkdir -p /opt/local/var/db/postgresql82/defaultdb
$ sudo chown postgres:postgres /opt/local/var/db/postgresql82/defaultdb
$ sudo su postgres -c '/opt/local/lib/postgresql82/bin/initdb -D /opt/local/var/db/postgresql82/defaultdb'    
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Have PostgreSQL start automatically on system start-ups&lt;/h4&gt;


	&lt;p&gt;Unless you&amp;#8217;re concerned about extra applications running in the background, I&amp;#8217;d encourage you to add PostgreSQL to launchd, which will start it automatically after system reboots.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;$ sudo launchctl load -w /Library/LaunchDaemons/org.macports.postgresql82-server.plist&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Adding PostgreSQL commands to your $PATH&lt;/h4&gt;


	&lt;p&gt;For some reason, MacPorts doesn&amp;#8217;t add the PostgreSQL programs to the default bash &lt;span class="caps"&gt;PATH&lt;/span&gt;, which means that you can&amp;#8217;t run &lt;code&gt;psql&lt;/code&gt;, &lt;code&gt;pg_dump&lt;/code&gt;, or &lt;code&gt;createdb&lt;/code&gt;/&lt;code&gt;dropdb&lt;/code&gt; without specifying the full path to where they were installed. What we&amp;#8217;ll do is add them to our default terminal profile.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;sudo vi /etc/profile&lt;/code&gt;&lt;/pre&gt; (you can use &lt;code&gt;mate&lt;/code&gt;, &lt;code&gt;emacs&lt;/code&gt;, &lt;code&gt;joe&lt;/code&gt; or any other preferred editor to do this)

	&lt;p&gt;This file gets loaded every time a new terminal session is started.&lt;/p&gt;


	&lt;p&gt;Let&amp;#8217;s add &lt;code&gt;/opt/local/lib/postgresql82/bin&lt;/code&gt; to the end of the value for &lt;span class="caps"&gt;PATH&lt;/span&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
PATH="/bin:/sbin:/usr/bin:/usr/sbin:/opt/local/lib/postgresql82/bin"    
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Save the file and then open a new terminal. To test this, you should get the following output when you run &lt;code&gt;which psql&lt;/code&gt;.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ which psql
/opt/local/lib/postgresql82/bin/psql
&lt;/code&gt;&lt;/pre&gt;

	&lt;h4&gt;Creating a new PostgreSQL user&lt;/h4&gt;


	&lt;p&gt;When I&amp;#8217;m working on Rails applications in my development environment, I really don&amp;#8217;t want to have to specify a username and password in every &lt;code&gt;config/database.yml&lt;/code&gt; file for each of our ongoing client projects. When PostgreSQL was installed, it created a superuser named &lt;code&gt;postgres&lt;/code&gt;, which is great, but I&amp;#8217;d like one that matches my system username, so that I&amp;#8217;m not prompted at all for a username or password to connect to PostgreSQL.&lt;/p&gt;


	&lt;p&gt;To do this, we&amp;#8217;ll use the &lt;code&gt;createuser&lt;/code&gt; command, which comes with PostgreSQL. As you can see, I&amp;#8217;m creating a new user with superuser privileges (and will hopefully be the last time I have to do a -U postgres).&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ createuser --superuser robbyrussell -U postgres
CREATE ROLE
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Let&amp;#8217;s take a quick moment to test this out.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
# create a new database
$ createdb my_test_db
CREATE DATABASE

# drop the database
$ dropdb my_test_db
DROP DATABASE
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Great, everything looks good here.&lt;/p&gt;


	&lt;p&gt;We now have a running installation of PostgreSQL with a new user account. All we need to do now is install the appropriate RubyGem to allow our Ruby applications to connect to it.&lt;/p&gt;


	&lt;h3&gt;Installing the Ruby Postgres gem&lt;/h3&gt;


	&lt;p&gt;&lt;strong&gt;&lt;span class="caps"&gt;UPDATE&lt;/span&gt;&lt;/strong&gt;: Hydro posted a commented, which lead me to the ruby-postgres gem.&lt;/p&gt;


	&lt;p&gt;You can install ruby-postgres gem by running the following command.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ sudo gem install -y ruby-postgres
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;Let&amp;#8217;s take a moment to test that this installed properly.&lt;/p&gt;


&lt;pre&gt;&lt;code&gt;
$ irb
irb(main):001:0&amp;gt; require 'rubygems'
=&amp;gt; true
irb(main):002:0&amp;gt; require 'postgres'
=&amp;gt; true
&lt;/code&gt;&lt;/pre&gt;

	&lt;p&gt;If this returns true, than we should be good to go. We&amp;#8217;ve now built a professional development environment for working with Ruby on Rails. &lt;strong&gt;Doesn&amp;#8217;t that feel great?&lt;/strong&gt;&lt;/p&gt;


	&lt;h2&gt;Test your install&lt;/h2&gt;


	&lt;p&gt;You can look back at &lt;a href="http://www.robbyonrails.com/articles/2006/05/29/install-ruby-rails-and-postgresql-on-osx"&gt;my older post&lt;/a&gt; to walk through the process of testing out your setup with a new Rails application.&lt;/p&gt;


	&lt;h2&gt;Closing thoughts&lt;/h2&gt;


	&lt;p&gt;I hope that this post has been useful for you. It took me a few hours to walk through this process and it&amp;#8217;s how all of our designers and developers at &lt;a href="http://planetargon.com"&gt;&lt;span class="caps"&gt;PLANET ARGON&lt;/span&gt;&lt;/a&gt; installs and configures their development environment.&lt;/p&gt;


	&lt;p&gt;We also install the following programs on new machines.&lt;/p&gt;


	&lt;ul&gt;
	&lt;li&gt;&lt;a href="http://macromates.com/"&gt;TextMate&lt;/a&gt;&lt;/li&gt;
		&lt;li&gt;Subversion: &lt;code&gt;sudo port install subversion&lt;/code&gt;&lt;/li&gt;
		&lt;li&gt;RSpec: &lt;code&gt;sudo gem install -y rspec&lt;/code&gt;&lt;/li&gt;
		&lt;li&gt;...amongst other gems that are needed on specific projects&lt;/li&gt;
	&lt;/ul&gt;


	&lt;p&gt;Until next time&amp;#8230; have fun!&lt;/p&gt;


	&lt;p id="fn1"&gt;&lt;sup&gt;1&lt;/sup&gt; Rumor: Mac &lt;span class="caps"&gt;OS X&lt;/span&gt; Leopard will give Terminal.app tabs! (&lt;a href="http://www.apple.com/macosx/leopard/technology/unix.html"&gt;see screenshot&lt;/a&gt;)&lt;/p&gt;</description>
      <pubDate>Tue, 19 Jun 2007 13:54:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:99f3a321-f222-4716-b70e-f62fcb7829c1</guid>
      <author>Robby Russell</author>
    