<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sean&#039;s Blog &#187; ruby</title>
	<atom:link href="http://seanbehan.com/category/ruby/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Transform Matching Text with Gsub in Ruby and Regular Expression</title>
		<link>http://seanbehan.com/ruby/transform-matching-text-with-gsub-in-ruby-and-regular-expression/</link>
		<comments>http://seanbehan.com/ruby/transform-matching-text-with-gsub-in-ruby-and-regular-expression/#comments</comments>
		<pubDate>Tue, 10 Jan 2012 21:31:58 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[gsub]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[string]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1489</guid>
		<description><![CDATA[Here is a gist that demonstrates how easy it is to transform text using #gsub and a block with Ruby. For more helpful string extensions in Ruby check out our Ruby Gem on GitHub https://github.com/AgilionApps/rails_extensions]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Ftransform-matching-text-with-gsub-in-ruby-and-regular-expression%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Transform Matching Text with Gsub in Ruby and Regular Expression" data-url="http://seanbehan.com/ruby/transform-matching-text-with-gsub-in-ruby-and-regular-expression/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Here is a gist that demonstrates how easy it is to transform text using #gsub and a block with Ruby.</p>
<p><script src="https://gist.github.com/1591261.js?file=gsub.rb"></script></p>
<p>For more helpful string extensions in Ruby check out our Ruby Gem on GitHub <a href="https://github.com/AgilionApps/rails_extensions">https://github.com/AgilionApps/rails_extensions</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/transform-matching-text-with-gsub-in-ruby-and-regular-expression/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Color Output with Test:Unit, AutoTest and Ruby 1.9</title>
		<link>http://seanbehan.com/ruby/color-output-with-testunit-autotest-and-ruby-1-9/</link>
		<comments>http://seanbehan.com/ruby/color-output-with-testunit-autotest-and-ruby-1-9/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 19:31:52 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[autotest]]></category>
		<category><![CDATA[color]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[testing]]></category>
		<category><![CDATA[tools]]></category>
		<category><![CDATA[workarounds]]></category>
		<category><![CDATA[workflow]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1486</guid>
		<description><![CDATA[If you are testing using Test:Unit (rather than RSpec) and you&#8217;re using Ruby 1.9.* colorized output of your tests using Autotest will not be immediately available. Since, 1.9 comes with mini test the test/unit/ui/console/testrunner.rb script is not loaded and not available and will break your tests. The solution is to require Test:Unit version 2.0.0 in [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fcolor-output-with-testunit-autotest-and-ruby-1-9%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Color Output with Test:Unit, AutoTest and Ruby 1.9" data-url="http://seanbehan.com/ruby/color-output-with-testunit-autotest-and-ruby-1-9/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>If you are testing using Test:Unit (rather than RSpec) and you&#8217;re using Ruby 1.9.* colorized output of your tests using Autotest will not be immediately available. Since, 1.9 comes with mini test the test/unit/ui/console/testrunner.rb script is not loaded and not available and will break your tests. </p>
<p>The solution is to require Test:Unit version 2.0.0 in your Gemfile, require the testrunner.rb script in test/test_helper.rb and reopen and implement the guess_color_availability method. </p>
<p><script src="https://gist.github.com/1575327.js"> </script></p>
<p>Then you can just run the autotest command (or bundle exec autotest) from your project directory. When you save a file your tests will be run for the file that has been changed and the results will be fully colorized!</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/color-output-with-testunit-autotest-and-ruby-1-9/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>How to Merge a YAML File Into a Single Hash in Ruby</title>
		<link>http://seanbehan.com/ruby/how-to-merge-a-yaml-file-into-a-single-hash-in-ruby/</link>
		<comments>http://seanbehan.com/ruby/how-to-merge-a-yaml-file-into-a-single-hash-in-ruby/#comments</comments>
		<pubDate>Sun, 08 Jan 2012 19:23:09 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[data structures]]></category>
		<category><![CDATA[hash]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[yaml]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1483</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fhow-to-merge-a-yaml-file-into-a-single-hash-in-ruby%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="How to Merge a YAML File Into a Single Hash in Ruby" data-url="http://seanbehan.com/ruby/how-to-merge-a-yaml-file-into-a-single-hash-in-ruby/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p><script src="https://gist.github.com/1571559.js"></script></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/how-to-merge-a-yaml-file-into-a-single-hash-in-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Class </title>
		<link>http://seanbehan.com/ruby/class/</link>
		<comments>http://seanbehan.com/ruby/class/#comments</comments>
		<pubDate>Fri, 23 Sep 2011 16:02:10 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1464</guid>
		<description><![CDATA[# Define a class with a class method &#34;find&#34; # Usage # Apple.find(&#34;macintosh&#34;) class Apple def self.find(variety) # code goes here end end # Same as above but notice the lack of self prefix before the method name # Usage # Apple.find(&#34;macintosh&#34;) class Apple class &#60;&#60; self def find(variety) # code goes here end end [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fclass%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Class " data-url="http://seanbehan.com/ruby/class/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><pre class="wp-code-highlight prettyprint">

# Define a class with a class method &quot;find&quot;
# Usage
# Apple.find(&quot;macintosh&quot;)
class Apple
   def self.find(variety)
      # code goes here
   end
end

# Same as above but notice the lack of self prefix before the method name
# Usage
# Apple.find(&quot;macintosh&quot;)
class Apple
   class &lt;&lt; self
      def find(variety)
         # code goes here
      end
   end
end
</pre>
<p>See the full pastie here: <a href="http://pastie.org/2580020">http://pastie.org/2580020</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/class/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Upgrade RVM on Mac OS X</title>
		<link>http://seanbehan.com/ruby/how-to-upgrade-rvm-on-mac-os-x/</link>
		<comments>http://seanbehan.com/ruby/how-to-upgrade-rvm-on-mac-os-x/#comments</comments>
		<pubDate>Sun, 26 Jun 2011 00:04:15 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[development environment]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[upgrading]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1431</guid>
		<description><![CDATA[I had an old version of rvm installed and wanted to upgrade. So old in fact that the resource for upgrading no longer existed. rvm update just returned a 301, redirect. Luckily, the following worked # checks out from repo rvm update --head # will reload rvm environment rvm reload # finally, the upgrade command [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fhow-to-upgrade-rvm-on-mac-os-x%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="How to Upgrade RVM on Mac OS X" data-url="http://seanbehan.com/ruby/how-to-upgrade-rvm-on-mac-os-x/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>I had an old version of rvm installed and wanted to upgrade. So old in fact that the resource for upgrading no longer existed. </p>
<pre class="wp-code-highlight prettyprint">
rvm update
</pre>
<p>just returned a 301, redirect. </p>
<p>Luckily, the following worked</p>
<pre class="wp-code-highlight prettyprint">
# checks out from repo
rvm update --head
# will reload rvm environment
rvm reload
# finally, the upgrade command works!
rvm get latest
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/how-to-upgrade-rvm-on-mac-os-x/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Ruby Reload! Method in Non Rails IRB Sessions</title>
		<link>http://seanbehan.com/ruby/ruby-reload-method-in-non-rails-irb-sessions/</link>
		<comments>http://seanbehan.com/ruby/ruby-reload-method-in-non-rails-irb-sessions/#comments</comments>
		<pubDate>Sat, 25 Jun 2011 01:49:36 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[development environments]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[rc files]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1424</guid>
		<description><![CDATA[I love the Rails reload! function when in the console. I need it in Irb. To get it back this is what I did. If you don&#8217;t already have an .irbrc file in your home directory, just create it. vim ~/.irbrc or textmate if you prefer mate ~/.irbrc Add this little snippet to it&#8230; unless [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fruby-reload-method-in-non-rails-irb-sessions%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Ruby Reload! Method in Non Rails IRB Sessions" data-url="http://seanbehan.com/ruby/ruby-reload-method-in-non-rails-irb-sessions/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>I love the Rails reload! function when in the console. I need it in Irb. To get it back this is what I did.  If you don&#8217;t already have an .irbrc file in your home directory, just create it. </p>
<pre class="wp-code-highlight prettyprint">
vim ~/.irbrc
or textmate if you prefer
mate ~/.irbrc
</pre>
<p>Add this little snippet to it&#8230;</p>
<pre class="wp-code-highlight prettyprint">
unless defined?(reload!)
  $files = []
  def load!(file)
    $files &lt;&lt; file
    load file
  end
  def reload!
    $files.each { |f| load f }
  end
end
</pre>
<p>Usage : To load files in irb just use the method we defined in the .irbrc file &#8220;load!&#8221; notice the bang &#8220;!&#8221;. I don&#8217;t want to overwrite the actual load method. This load! method will just put the file in an array before loading it, so when running reload! it will iterate over this collection and load them again with whatever changes have since taken place. The unless conditional is so that you don&#8217;t overwrite the reload! method if you&#8217;re actually in the rails console.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/ruby-reload-method-in-non-rails-irb-sessions/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Rand Range</title>
		<link>http://seanbehan.com/ruby/ruby-rand-range/</link>
		<comments>http://seanbehan.com/ruby/ruby-rand-range/#comments</comments>
		<pubDate>Sat, 04 Jun 2011 16:13:13 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[numbers]]></category>
		<category><![CDATA[one]]></category>
		<category><![CDATA[rand]]></category>
		<category><![CDATA[simple]]></category>
		<category><![CDATA[zero]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1336</guid>
		<description><![CDATA[I assumed that rand would take a range as an argument. Something like rand(10..20), generating a random number between 10 and 20. Seems like you&#8217;d do this fairly often when working with random numbers and therefore, included. However, it doesn&#8217;t work. But the solution is almost as easy. 10 + rand(11) #=&#62; produces a random [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fruby-rand-range%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Ruby Rand Range" data-url="http://seanbehan.com/ruby/ruby-rand-range/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>I assumed that rand would take a range as an argument. Something like rand(10..20), generating a random number between 10 and 20. Seems like you&#8217;d do this fairly often when working with random numbers and therefore, included. However, it doesn&#8217;t work. But the solution is almost as easy.</p>
<pre class="wp-code-highlight prettyprint">
10 + rand(11) #=&gt; produces a random number between 10 and 20
</pre>
<p>Since rand starts at 0 (like array indexes), we need to add an extra 1 to get what we&#8217;re expecting.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/ruby-rand-range/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems &gt;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org</title>
		<link>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/</link>
		<comments>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 14:00:21 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1211</guid>
		<description><![CDATA[After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time ./script/console production # =&#62; Loading production environment (Rails 2.3.5) Rails requires RubyGems &#62;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org You then scratch your head and run which gem which [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org" data-url="http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time</p>
<pre class="wp-code-highlight prettyprint">
./script/console production
# =&gt;
Loading production environment (Rails 2.3.5)
Rails requires RubyGems &gt;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
</pre>
<p>You then scratch your head and run </p>
<pre class="wp-code-highlight prettyprint">
which gem
which ruby
which rails
</pre>
<p>to find that all appears to be in order. You have rubygems installed , ruby is installed and so is rails. You also find that each are pointing to the correct location, which is something like /usr/bin/gem -> /opt/ruby-enterprise-x.x.x.x/bin/gem, where x.x.x.x is the version of REE. </p>
<p>The problem isn&#8217;t however, with any of the above. The issue is with the location of irb. If you installed (like me) irb with apt-get install irb, then irb isn&#8217;t aware of your shiny new REE and ruby gems. It&#8217;s a simple fix however, unlink irb and symlink the /usr/bin/irb to REE&#8217;s irb like so&#8230;  </p>
<pre class="wp-code-highlight prettyprint">
rm /usr/bin/irb
</pre>
<p>And symlink it to the irb that REE has in bin </p>
<pre class="wp-code-highlight prettyprint">
ln -s /opt/ruby-enterprise-x.x.x.x/bin/irb /usr/bin/irb
</pre>
<p>Now cd into your rails app and run </p>
<pre class="wp-code-highlight prettyprint">
./script/console production
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing and Using Rvm on Mac OS X, Creating Gemsets and Reverting to Original Environment</title>
		<link>http://seanbehan.com/mac-os-x/installing-and-using-rvm-on-mac-os-x-creating-gemsets-and-reverting-to-original-environment/</link>
		<comments>http://seanbehan.com/mac-os-x/installing-and-using-rvm-on-mac-os-x-creating-gemsets-and-reverting-to-original-environment/#comments</comments>
		<pubDate>Mon, 13 Sep 2010 17:35:23 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[mac os x]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[development]]></category>
		<category><![CDATA[environment]]></category>
		<category><![CDATA[rvm]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[version management]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1187</guid>
		<description><![CDATA[What is RVM and why should you use it? RVM is a Ruby interpreter, version management tool. In short, it enables you to switch between different versions and releases of Ruby (for instance, version 1.8.6, 1.8.7, jruby 1.9.2, ruby enterprise edition) on the same machine, while associating different gems with each version of the ruby [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fmac-os-x%2Finstalling-and-using-rvm-on-mac-os-x-creating-gemsets-and-reverting-to-original-environment%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Installing and Using Rvm on Mac OS X, Creating Gemsets and Reverting to Original Environment" data-url="http://seanbehan.com/mac-os-x/installing-and-using-rvm-on-mac-os-x-creating-gemsets-and-reverting-to-original-environment/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>What is RVM and why should you use it? RVM is a Ruby interpreter, version management tool. In short, it enables you to switch between different versions and releases of Ruby (for instance, version 1.8.6, 1.8.7, jruby 1.9.2, ruby enterprise edition) on the same machine, while associating different gems with each version of the ruby interpreter. This is super useful and awesome. If you want to play with Rails 3 and Ruby 1.9.1, for 5 minutes, and then want to switch back to your production apps, which are running on Rails 2.3.5 and Ruby 1.8.7, you can do so with a single command from the terminal. With RVM this is a fairly simple process so there is no reason not to install it. You can also revert back to your system settings (not using RVM) with a single command. After all Rails is just a gem, so you can easily create and manage different RVM &#8220;gemsets&#8221;, (sets of different gems), for the different versions of Ruby (rubies as RVM refers to them) you have installed.      </p>
<p>Installing RVM  </p>
<pre class="wp-code-highlight prettyprint">
bash &lt; &lt;(curl -s https://rvm.beginrescueend.com/install/rvm)
</pre>
<p>Next you have to add rvm to your bash profile</p>
<pre class="wp-code-highlight prettyprint">
# place in ~/.bash_profile as the very last line
[[ -s &quot;$HOME/.rvm/scripts/rvm&quot; ]] &amp;&amp; . &quot;$HOME/.rvm/scripts/rvm&quot;
</pre>
<p>To check everything went well</p>
<pre class="wp-code-highlight prettyprint">
type rvm | head -n1
</pre>
<p>Should tell you &#8220;rvm is a function&#8221; </p>
<p>How to add ruby, pass it the version to install </p>
<pre class="wp-code-highlight prettyprint">
rvm install 1.8.7
</pre>
<p>*The current terminal session will load this environment. New sessions will not. To use a version of ruby and set it as the default, pass it the &#8211;default option</p>
<pre class="wp-code-highlight prettyprint">
rvm use 1.8.7 --default
</pre>
<p>Next create a gemset, which will make available different gems for different versions</p>
<pre class="wp-code-highlight prettyprint">
rvm gemset create rails_2_3_5
</pre>
<p>When you run &#8220;gem list&#8221;, you should see nothing!</p>
<pre class="wp-code-highlight prettyprint">
gem install rails -v=2.3.5
</pre>
<p>Set a default rvm and default gemset, specify which gemset with the @ sign and include the &#8211;default option</p>
<pre class="wp-code-highlight prettyprint">
rvm use 1.8.7@rails_2_3_5 --default
</pre>
<pre class="wp-code-highlight prettyprint">
which gem
gem list
ruby --version
rails --version
</pre>
<p>And to get back to where you started and revert to using your original ruby setup </p>
<pre class="wp-code-highlight prettyprint">
rvm system
</pre>
<p>For upgrading your version of RVM check out this post I wrote <a href="http://seanbehan.com/ruby/how-to-upgrade-rvm-on-mac-os-x/">http://seanbehan.com/ruby/how-to-upgrade-rvm-on-mac-os-x/</a></p>
<p>Finally, you can create a .rvmrc file and put it in any directory and when you cd into that directory the environment specified in the file will be loaded automatically. This way you don&#8217;t have to remember the version and gemsets and type them into the console. All you have to do is put the ruby version and gemset name in the file like so</p>
<pre class="wp-code-highlight prettyprint">ruby1.8.7@rails2.3.5</pre>
<p>You&#8217;ll be prompted to trust the .rvmrc file the first time, type &#8220;y&#8221; for yes. Also, subdirectories will inherit this .rvmrc so you can just put it in the parent directory like</p>
<pre class="wp-code-highlight prettyprint">
rails2/
     .rvmrc
     app1
     app2
rails3/
     .rvmrc
     app1
     app2
</pre>
<p>And both app1 and app2 will use the .rvmrc environment while your rails3 directory apps will load the environment in its directory!</p>
<p>More information available here:<br />
<a href="http://rvm.beginrescueend.com/rvm/install/">http://rvm.beginrescueend.com/rvm/install/</a><br />
<a href="http://www.stjhimy.com/posts/4">http://www.stjhimy.com/posts/4</a><br />
<a href="http://eddorre.com/posts/installing-rails-3-beta-4-using-rvm">http://eddorre.com/posts/installing-rails-3-beta-4-using-rvm</a></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/mac-os-x/installing-and-using-rvm-on-mac-os-x-creating-gemsets-and-reverting-to-original-environment/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Combat Spam with the Akismet Class for Ruby</title>
		<link>http://seanbehan.com/ruby/combat-spam-with-the-akismet-class-for-ruby/</link>
		<comments>http://seanbehan.com/ruby/combat-spam-with-the-akismet-class-for-ruby/#comments</comments>
		<pubDate>Fri, 10 Sep 2010 18:42:59 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[ruby]]></category>
		<category><![CDATA[akismet]]></category>
		<category><![CDATA[library]]></category>
		<category><![CDATA[spam]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1179</guid>
		<description><![CDATA[Here is the Akismet.rb class, written by David Czarnecki. I&#8217;ve seen several tutorials online using this class, however, the class isn&#8217;t available at David&#8217;s blog. So&#8230; I reposted it here and at the pastie link below http://pastie.org/1150693]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby%2Fcombat-spam-with-the-akismet-class-for-ruby%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Combat Spam with the Akismet Class for Ruby" data-url="http://seanbehan.com/ruby/combat-spam-with-the-akismet-class-for-ruby/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Here is the Akismet.rb class, written by David Czarnecki. I&#8217;ve seen several tutorials online using this class, however, the class isn&#8217;t available at David&#8217;s blog. So&#8230; I reposted it here and at the pastie link below<br />
<a href="http://pastie.org/1150693">http://pastie.org/1150693</a></p>
<p><script src='http://pastie.org/1150693.js'></script></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby/combat-spam-with-the-akismet-class-for-ruby/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

