<?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/tag/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>How to Add Additional Sub Directories to the Default Rails Test:Unit File Structure</title>
		<link>http://seanbehan.com/ruby-on-rails/how-to-add-additional-sub-directories-to-the-default-rails-testunit-file-structure/</link>
		<comments>http://seanbehan.com/ruby-on-rails/how-to-add-additional-sub-directories-to-the-default-rails-testunit-file-structure/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 21:44:54 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[configuration]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[rake]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[setup]]></category>
		<category><![CDATA[sub directories]]></category>
		<category><![CDATA[tdd]]></category>
		<category><![CDATA[test]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1496</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-on-rails%2Fhow-to-add-additional-sub-directories-to-the-default-rails-testunit-file-structure%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 Add Additional Sub Directories to the Default Rails Test:Unit File Structure" data-url="http://seanbehan.com/ruby-on-rails/how-to-add-additional-sub-directories-to-the-default-rails-testunit-file-structure/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p><script src="https://gist.github.com/1635859.js"> </script></p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/how-to-add-additional-sub-directories-to-the-default-rails-testunit-file-structure/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<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>1</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>Email Regex</title>
		<link>http://seanbehan.com/tips-snippets/email-regex/</link>
		<comments>http://seanbehan.com/tips-snippets/email-regex/#comments</comments>
		<pubDate>Sun, 03 Jul 2011 03:38:52 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[tips & snippets]]></category>
		<category><![CDATA[email parsing]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[ruby]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1445</guid>
		<description><![CDATA[Regular Expression that Matches Email Addresses: /\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/]]></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%2Ftips-snippets%2Femail-regex%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="Email Regex" data-url="http://seanbehan.com/tips-snippets/email-regex/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Regular Expression that Matches Email Addresses:</p>
<pre class="wp-code-highlight prettyprint">
/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}\b/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/tips-snippets/email-regex/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>3</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>Installing Ruby on Rails 3, MySQL, Git, Ruby Enterprise Edition, Passenger (Mod_Rails) on Ubuntu with Rackspace Cloud.</title>
		<link>http://seanbehan.com/ruby-on-rails/installing-ruby-on-rails-3-mysql-git-ruby-enterprise-edition-passenger-mod_rails-on-ubuntu-with-rackspace-cloud/</link>
		<comments>http://seanbehan.com/ruby-on-rails/installing-ruby-on-rails-3-mysql-git-ruby-enterprise-edition-passenger-mod_rails-on-ubuntu-with-rackspace-cloud/#comments</comments>
		<pubDate>Wed, 23 Mar 2011 19:12:46 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[rackspace]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1269</guid>
		<description><![CDATA[Short and sweet. Here all the commands I run in this order to set up a brand new box. It usually takes about 10 &#8211; 15 minutes on a 256 MB RAM instance. Compiling Ruby Enterprise Edition, which is super easy, will take the most amount of time. It will seem to have gotten stuck. [...]]]></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-on-rails%2Finstalling-ruby-on-rails-3-mysql-git-ruby-enterprise-edition-passenger-mod_rails-on-ubuntu-with-rackspace-cloud%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 Ruby on Rails 3, MySQL, Git, Ruby Enterprise Edition, Passenger (Mod_Rails) on Ubuntu with Rackspace Cloud." data-url="http://seanbehan.com/ruby-on-rails/installing-ruby-on-rails-3-mysql-git-ruby-enterprise-edition-passenger-mod_rails-on-ubuntu-with-rackspace-cloud/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Short and sweet. Here all the commands I run in this order to set up a brand new box. It usually takes about 10 &#8211; 15 minutes on a 256 MB RAM instance. Compiling Ruby Enterprise Edition, which is super easy, will take the most amount of time. It will seem to have gotten stuck. It hasn&#8217;t. It just takes a little while. </p>
<pre class="wp-code-highlight prettyprint">
# Update, upgrade and install all necessary packages for Ruby on Rails server if you've got a fresh Ubuntu slice
apt-get update
apt-get upgrade

apt-get install build-essential patch libssl-dev libreadline5-dev

apt-get install ruby1.8-dev ruby1.8 ri1.8 rdoc1.8 irb1.8 libreadline-ruby1.8 libruby1.8 libopenssl-ruby imagemagick librmagick-ruby1.8 librmagick-ruby-doc libfreetype6-dev xml-core postfix
# postfix will prompt you for details
# use Internet Site and enter in the domain name you are planning on sending email from 

apt-get install apache2 apache2-prefork-dev libapr1-dev libaprutil1-dev libcurl4-openssl-dev git-core mysql-server mysql-client libmysqlclient15-dev libmysql-ruby
# mysql will also prompt you to set up a root user account. set the password to be anything you like

# next, download the latest release of ruby enterprise edition but when you're installing it on your own machine version numbers and release dates may have changed.
# pay attention to the version and release date before the file extension. it will be something like
# ... 1.8.7-2010.02
# this will change to something like 2011.03, 2011.04... etc in the future.
# just double check the paths on when you are installing and make the necessary substitutions

# ruby enterprise edition is available at http://www.rubyenterpriseedition.com/download.html
wget http://rubyforge.org/frs/download.php/71096/ruby-enterprise-1.8.7-2010.02.tar.gz
tar xzvf ruby-enterprise-1.8.7-2010.02.tar.gz 

./ruby-enterprise-1.8.7-2010.02/installer
# this may take a little while (just follow the instructions)
# and hit enter to install in default location (recommended) when prompted 

# and to install passenger (which is mod_rails for apache)
/opt/ruby-enterprise-1.8.7-2010.02/bin/passenger-install-apache2-module 

# i take the output from the above script and add it to my available modules directory
vim /etc/apache2/mods-available/passenger.conf

# and enter something like this in the newly created file (your version numbers will prob. be different)
LoadModule passenger_module /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.7-2010.02/lib/ruby/gems/1.8/gems/passenger-3.0.2
PassengerRuby /opt/ruby-enterprise-1.8.7-2010.02/bin/ruby

# and then sym link it to the enabled directory so that apache knows about it
ln -s /etc/apache2/mods-available/passenger.conf /etc/apache2/mods-enabled/passenger.conf

# and now i want to include ruby enterprise edition in my path so i add it to my profile (again make sure the path is correct)
vim /etc/profile.d/passenger.sh
export PATH=/opt/ruby-enterprise-1.8.7-2010.02/bin:$PATH

. /etc/profile.d/passenger.sh
# the &quot;.&quot; file will make the setting available for the current terminal session
rails -v
ruby -v
rake -v
# should all be working now
# and
which ruby
# should point to the ruby enterprise edition under /opt

# next i
# set up public/private keys
# so i can do
# ssh localhost without using a password
cd
test -e ~/.ssh/id_dsa.pub || ssh-keygen -t dsa
cat ~/.ssh/id_dsa.pub &gt;&gt; ~/.ssh/authorized_keys2

# and finally install git
apt-get install git-core
</pre>
<p>You should now have a server ready to server ruby on rails applications!</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/installing-ruby-on-rails-3-mysql-git-ruby-enterprise-edition-passenger-mod_rails-on-ubuntu-with-rackspace-cloud/feed/</wfw:commentRss>
		<slash:comments>2</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>
	</channel>
</rss>

