<?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>Jonathan Spooner is a Web Developer in the San Diego Area. &#187; Ruby on Rails</title>
	<atom:link href="http://www.jonathanspooner.com/category/web-development/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.jonathanspooner.com</link>
	<description>Flex Developer, Air Developer, and ActionScript Programmer</description>
	<lastBuildDate>Fri, 28 May 2010 16:42:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Ruby5 #3 &#8211; Rspec stubbing named_scope in a controller</title>
		<link>http://www.jonathanspooner.com/web-development/ruby5-3-rspec-stubbing-named_scope-in-a-controller/</link>
		<comments>http://www.jonathanspooner.com/web-development/ruby5-3-rspec-stubbing-named_scope-in-a-controller/#comments</comments>
		<pubDate>Fri, 28 May 2010 16:42:35 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby 5]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/?p=663</guid>
		<description><![CDATA[I found the stub_chain method very helpful when stubbing out objects for Rspec controller testing.
My index action is calling 2 named_scopes and then doing a find.
&#160;
  def index
    @exercise_logs = ExerciseLog.this_user&#40;current_user&#41;.past.all
  end
&#160;
When testing controllers your just trying to stub out a value for @exercise_logs not simulating an actual call to [...]]]></description>
			<content:encoded><![CDATA[<p>I found the <code>stub_chain</code> method very helpful when stubbing out objects for Rspec controller testing.</p>
<p>My index action is calling 2 named_scopes and then doing a find.</p>
<pre class="ruby">&nbsp;
  <span style="color:#9966CC; font-weight:bold;">def</span> index
    <span style="color:#0066ff; font-weight:bold;">@exercise_logs</span> = ExerciseLog.<span style="color:#9900CC;">this_user</span><span style="color:#006600; font-weight:bold;">&#40;</span>current_user<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">past</span>.<span style="color:#9900CC;">all</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>When testing controllers your just trying to stub out a value for @exercise_logs not simulating an actual call to your model.  So we'll use the stub_chain method to stub out our named_scopes like this.  </p>
<pre class="ruby">&nbsp;
    it <span style="color:#996600;">&quot;assigns all exercise_logs as @exercise_logs&quot;</span> <span style="color:#9966CC; font-weight:bold;">do</span>
      ExerciseLog.<span style="color:#9900CC;">stub_chain</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:this_user</span>,:past<span style="color:#006600; font-weight:bold;">&#41;</span>.<span style="color:#9900CC;">and_return</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#006600; font-weight:bold;">&#91;</span>mock<span style="color:#006600; font-weight:bold;">&#40;</span>ExerciseLog<span style="color:#006600; font-weight:bold;">&#41;</span>,mock<span style="color:#006600; font-weight:bold;">&#40;</span>ExerciseLog<span style="color:#006600; font-weight:bold;">&#41;</span><span style="color:#006600; font-weight:bold;">&#93;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
      get <span style="color:#ff3333; font-weight:bold;">:index</span>
      response.<span style="color:#9900CC;">should</span> be_success
    <span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>Resources:<br />
<a href="http://stackoverflow.com/questions/1638814/stubbing-named-scope-in-an-rspec-controller/2930723#2930723">http://stackoverflow.com/questions/1638814/stubbing-named-scope-in-an-rspec-controller/2930723#2930723</a></p>
<p><a href="http://apidock.com/rspec/Spec/Mocks/Methods/stub_chain">http://apidock.com/rspec/Spec/Mocks/Methods/stub_chain</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/ruby5-3-rspec-stubbing-named_scope-in-a-controller/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby5 #2 &#8211; Rails Securing Passwords</title>
		<link>http://www.jonathanspooner.com/web-development/ruby5-2-rails-securing-passwords/</link>
		<comments>http://www.jonathanspooner.com/web-development/ruby5-2-rails-securing-passwords/#comments</comments>
		<pubDate>Fri, 28 May 2010 16:19:27 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby 5]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/?p=650</guid>
		<description><![CDATA[It's important to filter out any sensitive data such as passwords from your log files.  You can easily filter out data across your while application by calling filter_paramter_logging from your ApplicationController.  In the example below I'm passing :password and :password_confirmation to remove their values from being placed in the logs.
ActionController::Base
&#160;
class ApplicationController &#60; ActionController::Base
 [...]]]></description>
			<content:encoded><![CDATA[<p>It's important to filter out any sensitive data such as passwords from your log files.  You can easily filter out data across your while application by calling <code>filter_paramter_logging</code> from your ApplicationController.  In the example below I'm passing <code>:password</code> and <code>:password_confirmation</code> to remove their values from being placed in the logs.</p>
<p><a href="http://rails.rubyonrails.org/classes/ActionController/Base.html#M000453">ActionController::Base</a></p>
<pre class="ruby">&nbsp;
<span style="color:#9966CC; font-weight:bold;">class</span> ApplicationController &lt; <span style="color:#6666ff; font-weight:bold;">ActionController::Base</span>
  filter_parameter_logging <span style="color:#ff3333; font-weight:bold;">:password</span>, <span style="color:#ff3333; font-weight:bold;">:password_confirmation</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;</pre>
<p>You will now see "FILTERED" in place of sensitive data.</p>
<pre class="ruby">&nbsp;
  Parameters: <span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;x&quot;</span>=&gt;<span style="color:#996600;">&quot;37&quot;</span>, <span style="color:#996600;">&quot;y&quot;</span>=&gt;<span style="color:#996600;">&quot;14&quot;</span>, <span style="color:#996600;">&quot;action&quot;</span>=&gt;<span style="color:#996600;">&quot;login&quot;</span>, <span style="color:#996600;">&quot;authenticity_token&quot;</span>=&gt;<span style="color:#996600;">&quot;JRFNcG9chNIpcsHoJzcQRRy1D6lIenjl7cWmvp3UpaI=&quot;</span>, <span style="color:#996600;">&quot;controller&quot;</span>=&gt;<span style="color:#996600;">&quot;videos&quot;</span>, <span style="color:#996600;">&quot;user_id&quot;</span>=&gt;<span style="color:#996600;">&quot;7-Jonathan-SpoonerJune&quot;</span>, <span style="color:#996600;">&quot;video&quot;</span>=&gt;<span style="color:#006600; font-weight:bold;">&#123;</span><span style="color:#996600;">&quot;password&quot;</span>=&gt;<span style="color:#996600;">&quot;[FILTERED]&quot;</span>, <span style="color:#996600;">&quot;email&quot;</span>=&gt;<span style="color:#996600;">&quot;june@gmail.com&quot;</span><span style="color:#006600; font-weight:bold;">&#125;</span><span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/ruby5-2-rails-securing-passwords/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying a Rails app to Amazon EC2 with Capistrano</title>
		<link>http://www.jonathanspooner.com/web-development/deploying-a-rails-app-to-amazon-ec2-with-capistrano/</link>
		<comments>http://www.jonathanspooner.com/web-development/deploying-a-rails-app-to-amazon-ec2-with-capistrano/#comments</comments>
		<pubDate>Tue, 27 Apr 2010 18:30:38 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[ec2]]></category>
		<category><![CDATA[ec2onrails]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/?p=557</guid>
		<description><![CDATA[@esilverberg originally posted this article that I've been referring to for the past year and now wanted to contribute some updates of my own.
Get the code
Arr!  There are some problems with checking out code from github with SVN.  I'll fix this soon but if your reading today modify deploy.rb to deploy from git.
We're [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://twitter.com/esilverberg">@esilverberg</a> originally posted <a href="http://www-cs-students.stanford.edu/~silver/ec2.html">this article</a> that I've been referring to for the past year and now wanted to contribute some updates of my own.</p>
<h2>Get the code</h2>
<p>Arr!  There are some problems with checking out code from github with SVN.  I'll fix this soon but if your reading today modify deploy.rb to deploy from git.</p>
<p>We're going to deploy my <a href="http://github.com/jspooner/authlogic_cucumber_rspec_example">stub site</a> from github and we'll check it out with SubVersion</p>
<pre class="bash">&nbsp;
svn checkout  http://svn.github.com/jspooner/authlogic_cucumber_rspec_example.git basic
<span style="color: #7a0874; font-weight: bold;">cd</span> basic
&nbsp;</pre>
<p>You probably want to get the project running locally.  Hopefully you have the mysql driver installed or you can edit the database.yml file to use sqlite.</p>
<pre class="bash">&nbsp;
rake db:create
rake db:migrate
rake db:seed
script/server
&nbsp;</pre>
<h2>EC2 setup</h2>
<ol>
<li>Read the <a href="http://docs.amazonwebservices.com/AmazonEC2/gsg/2006-06-26/">getting started guide here</a> at amazon.</li>
<li>Install the developer tools.  I have them located at
<pre>ec2-ami-tools-1.3-45758</pre>
</li>
<li>Make sure you have downloaded the cert- and pk- .pem files. I have them in ~/.ec2/</li>
</ol>
<h3>Setup environment variables</h3>
<p>Probably want to put these in your .bashrc or .bash_profile with the 'export' command in front.</p>
<pre class="bash">&nbsp;
     <span style="color: #007800;">EC2_CERT=</span>/home/USER/.ec2/cert-EZC7LAIYSKPC546UKT7E3PI.pem
     <span style="color: #007800;">EC2_HOME=</span>/home/USER/ec2-api-tools<span style="color: #000000;">-1.3</span><span style="color: #000000;">-30349</span>
     <span style="color: #007800;">EC2_PRIVATE_KEY=</span>/home/USER/.ec2/pk-EZC7LAIYSKPC546UKT7EUEOOI.pem
     <span style="color: #007800;">PATH=</span><span style="color: #007800;">$PATH</span>:<span style="color: #007800;">$EC2_HOME</span>/bin
&nbsp;</pre>
<h3>Verify dev tools</h3>
<p>Run this to make sure it works:
<pre class="bash">ec2-describe-images ami-5394733a</pre>
<h3>Start up an instance</h3>
<ol>
<li>Click "Launch Instance" https://console.aws.amazon.com/ec2/home<br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-10.54.01-AM.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-10.54.01-AM.png" alt="" title="Screen shot 2010-04-29 at 10.54.01 AM" width="420" height="164" class="alignnone size-full wp-image-582" /></a>
</li>
<li>Click "Community AMI's" and select one of the AMI's listed when you ran cap ec2onrails:ami_ids.  I'm using ami-5394733a
<p><a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.21.46-AM.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.21.46-AM-150x150.png" alt="" title="Screen shot 2010-04-29 at 11.21.46 AM" width="150" height="150" class="alignnone size-thumbnail wp-image-589" /></a></p>
</li>
<li>Select an instance size and continue.<br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.22.38-AM.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.22.38-AM-150x150.png" alt="" title="Screen shot 2010-04-29 at 11.22.38 AM" width="150" height="150" class="alignnone size-thumbnail wp-image-592" /></a>
</li>
<li>Advanced Instance Options.  Click Continue.<br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.25.30-AM.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.25.30-AM-150x150.png" alt="" title="Screen shot 2010-04-29 at 11.25.30 AM" width="150" height="150" class="alignnone size-thumbnail wp-image-593" /></a></li>
<li>Create a new Key Pair named testkey and click download.  Move this file to ~/.ssh/testkey.pem and chmod the key to 600.
<pre class="bash">&nbsp;
   <span style="color: #c20cb9; font-weight: bold;">mv</span> testkey.pem ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/testkey.pem
   <span style="color: #7a0874; font-weight: bold;">cd</span> ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/
   <span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">600</span> testkey.pem
   <span style="color: #c20cb9; font-weight: bold;">ls</span> -al
&nbsp;</pre>
<p>You should see the file permissions set to -rw-------<br />
This key is used to SSH into your instance and is used set on line 13 of deploy.rb.</p>
<pre class="ruby">ssh_options[:keys] = ["#{ENV['HOME']}/.ssh/testkey.pem"]</pre>
</li>
<li>Create a new Security Group and rules for HTTP HTTPS & SSH.<br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.31.20-AM.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.31.20-AM-150x150.png" alt="" title="Screen shot 2010-04-29 at 11.31.20 AM" width="150" height="150" class="alignnone size-thumbnail wp-image-594" /></a>
</li>
<li>Verify your settings and Launch the Instance<br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.32.19-AM.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-29-at-11.32.19-AM-150x150.png" alt="" title="Screen shot 2010-04-29 at 11.32.19 AM" width="150" height="150" class="alignnone size-thumbnail wp-image-595" /></a></li>
<li>After you instance has launched find the Public DNS that looks something like this ec2-xxx-xxx-xx-xxx.compute-1.amazonaws.com and add that to you deploy.rb file on lines 18-21</li>
</ol>
<h3> Update tools on the image </h3>
<p>ssh into the machine and run the following</p>
<pre class="bash">
ssh -i ~/.ssh/testkey.pem root@ec2-xxx-xxx-xx-xxx.compute-1.amazonaws.com
sudo apt-get update
sudo apt-get -y install build-essential
sudo apt-get -y install emacs22
sudo gem update --system
</pre>
<p>The <a href="http://www-cs-students.stanford.edu/~silver/ec2.html">original post</a> had you installing imagemagick with apt-get but that wan't pulling the latest version; which the rmagick gem requires.  So here we will pull down the latest version and install from source.</p>
<pre class="bash">&nbsp;
<span style="color: #c20cb9; font-weight: bold;">wget</span> <span style="color: #c20cb9; font-weight: bold;">ftp</span>://<span style="color: #c20cb9; font-weight: bold;">ftp</span>.imagemagick.org/pub/ImageMagick/ImageMagick.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz
<span style="color: #c20cb9; font-weight: bold;">tar</span> -zxvf ImageMagick.<span style="color: #c20cb9; font-weight: bold;">tar</span>.gz
<span style="color: #7a0874; font-weight: bold;">cd</span> ImageMagick<span style="color: #000000;">-6.6</span><span style="color: #000000;">.1</span><span style="color: #000000;">-5</span>/
./configure
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span>
gem <span style="color: #c20cb9; font-weight: bold;">install</span> rmagick
&nbsp;</pre>
<h3>Set up capistrano and <a href="http://ec2onrails.rubyforge.org/">ec2onrails</a></h3>
<p><a href="http://www.capify.org/index.php/Capistrano">Capistrano</a> is a tool for automating tasks on one or more remote servers.  We are going to use it to push our site up to EC2 with the help of the <a href="http://ec2onrails.rubyforge.org/">ec2onrails</a> gem.</p>
<pre class="bash">
capify .
gem install ec2onrails
</pre>
<p>Open Capfile and require ec2onrails.</p>
<pre class="bash">require 'ec2onrails/recipes'</pre>
<p>Open deploy.rb and replace with this.</p>
<pre class="ruby">&nbsp;
<span style="color:#008000; font-style:italic;"># This is a sample Capistrano config file for EC2 on Rails.</span>
<span style="color:#008000; font-style:italic;"># It should be edited and customized.</span>
&nbsp;
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;basic&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">&quot;root&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:use_sudo</span>, <span style="color:#0000FF; font-weight:bold;">true</span>
set <span style="color:#ff3333; font-weight:bold;">:repository</span>, <span style="color:#996600;">&quot;http://svn.github.com/jspooner/authlogic_cucumber_rspec_example.git &quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># NOTE: for some reason Capistrano requires you to have both the public and</span>
<span style="color:#008000; font-style:italic;"># the private key in the same folder, the public key should have the</span>
<span style="color:#008000; font-style:italic;"># extension &quot;.pub&quot;.</span>
ssh_options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:keys</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;#{ENV['HOME']}/.ssh/testkey.pem&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Your EC2 instances. Use the ec2-xxx....amazonaws.com hostname, not</span>
<span style="color:#008000; font-style:italic;"># any other name (in case you have your own DNS alias) or it won't</span>
<span style="color:#008000; font-style:italic;"># be able to resolve to the internal IP address.</span>
role <span style="color:#ff3333; font-weight:bold;">:web</span>,      <span style="color:#996600;">&quot;ec2-xx-xx-xx-xx.compute-1.amazonaws.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:app</span>,      <span style="color:#996600;">&quot;ec2-xx-xx-xx-xx.compute-1.amazonaws.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:db</span>,       <span style="color:#996600;">&quot;ec2-xx-xx-xx-xx.compute-1.amazonaws.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> =&gt; <span style="color:#0000FF; font-weight:bold;">true</span>
role <span style="color:#ff3333; font-weight:bold;">:memcache</span>, <span style="color:#996600;">&quot;ec2-xx-xx-xx-xx.compute-1.amazonaws.com&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># Whatever you set here will be taken set as the default RAILS_ENV value</span>
<span style="color:#008000; font-style:italic;"># on the server. Your app and your hourly/daily/weekly/monthly scripts</span>
<span style="color:#008000; font-style:italic;"># will run with RAILS_ENV set to this value.</span>
set <span style="color:#ff3333; font-weight:bold;">:rails_env</span>, <span style="color:#996600;">&quot;production&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># EC2 on Rails config.</span>
<span style="color:#008000; font-style:italic;"># NOTE: Some of these should be omitted if not needed.</span>
set <span style="color:#ff3333; font-weight:bold;">:ec2onrails_config</span>, <span style="color:#006600; font-weight:bold;">&#123;</span>
  <span style="color:#008000; font-style:italic;"># S3 bucket and &quot;subdir&quot; used by the ec2onrails:db:restore task</span>
  <span style="color:#008000; font-style:italic;"># :restore_from_bucket =&gt; &quot;your-bucket&quot;,</span>
  <span style="color:#008000; font-style:italic;"># :restore_from_bucket_subdir =&gt; &quot;database&quot;,</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># S3 bucket and &quot;subdir&quot; used by the ec2onrails:db:archive task</span>
  <span style="color:#008000; font-style:italic;"># This does not affect the automatic backup of your MySQL db to S3, it's</span>
  <span style="color:#008000; font-style:italic;"># just for manually archiving a db snapshot to a different bucket if</span>
  <span style="color:#008000; font-style:italic;"># desired.</span>
  <span style="color:#008000; font-style:italic;"># :archive_to_bucket =&gt; &quot;your-other-bucket&quot;,</span>
  <span style="color:#008000; font-style:italic;"># :archive_to_bucket_subdir =&gt; &quot;db-archive/#{Time.new.strftime('%Y-%m-%d--%H-%M-%S')}&quot;,</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># Set a root password for MySQL. Run &quot;cap ec2onrails:db:set_root_password&quot;</span>
  <span style="color:#008000; font-style:italic;"># to enable this. This is optional, and after doing this the</span>
  <span style="color:#008000; font-style:italic;"># ec2onrails:db:drop task won't work, but be aware that MySQL accepts</span>
  <span style="color:#008000; font-style:italic;"># connections on the public network interface (you should block the MySQL</span>
  <span style="color:#008000; font-style:italic;"># port with the firewall anyway).</span>
  <span style="color:#008000; font-style:italic;"># If you don't care about setting the mysql root password then remove this.</span>
  <span style="color:#ff3333; font-weight:bold;">:mysql_root_password</span> =&gt; <span style="color:#996600;">&quot;blamblam12343&quot;</span>,
&nbsp;
  <span style="color:#008000; font-style:italic;"># Any extra Ubuntu packages to install if desired</span>
  <span style="color:#008000; font-style:italic;"># If you don't want to install extra packages then remove this.</span>
  <span style="color:#ff3333; font-weight:bold;">:packages</span> =&gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;logwatch&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
&nbsp;
  <span style="color:#008000; font-style:italic;"># Any extra RubyGems to install if desired: can be &quot;gemname&quot; or if a</span>
  <span style="color:#008000; font-style:italic;"># particular version is desired &quot;gemname -v 1.0.1&quot;</span>
  <span style="color:#008000; font-style:italic;"># If you don't want to install extra rubygems then remove this</span>
  <span style="color:#ff3333; font-weight:bold;">:rubygems</span> =&gt; <span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#996600;">&quot;rails -v 2.3.5&quot;</span><span style="color:#006600; font-weight:bold;">&#93;</span>,
&nbsp;
  <span style="color:#008000; font-style:italic;"># Set the server timezone. run &quot;cap -e ec2onrails:server:set_timezone&quot; for</span>
  <span style="color:#008000; font-style:italic;"># details</span>
  <span style="color:#ff3333; font-weight:bold;">:timezone</span> =&gt; <span style="color:#996600;">&quot;Canada/Eastern&quot;</span>,
&nbsp;
  <span style="color:#008000; font-style:italic;"># Files to deploy to the server (they'll be owned by root). It's intended</span>
  <span style="color:#008000; font-style:italic;"># mainly for customized config files for new packages installed via the</span>
  <span style="color:#008000; font-style:italic;"># ec2onrails:server:install_packages task. Subdirectories and files inside</span>
  <span style="color:#008000; font-style:italic;"># here will be placed in the same structure relative to the root of the</span>
  <span style="color:#008000; font-style:italic;"># server's filesystem.</span>
  <span style="color:#008000; font-style:italic;"># If you don't need to deploy customized config files to the server then</span>
  <span style="color:#008000; font-style:italic;"># remove this.</span>
  <span style="color:#008000; font-style:italic;"># :server_config_files_root =&gt; &quot;../server_config&quot;,</span>
&nbsp;
  <span style="color:#008000; font-style:italic;"># If config files are deployed, some services might need to be restarted.</span>
  <span style="color:#008000; font-style:italic;"># If you don't need to deploy customized config files to the server then</span>
  <span style="color:#008000; font-style:italic;"># remove this.</span>
  <span style="color:#ff3333; font-weight:bold;">:services_to_restart</span> =&gt; %w<span style="color:#006600; font-weight:bold;">&#40;</span>apache2 postfix sysklogd<span style="color:#006600; font-weight:bold;">&#41;</span>,
&nbsp;
  <span style="color:#008000; font-style:italic;"># Set an email address to forward admin mail messages to. If you don't</span>
  <span style="color:#008000; font-style:italic;"># want to receive mail from the server (e.g. monit alert messages) then</span>
  <span style="color:#008000; font-style:italic;"># remove this.</span>
  <span style="color:#ff3333; font-weight:bold;">:admin_mail_forward_address</span> =&gt; <span style="color:#996600;">&quot;me@gmail.com&quot;</span>,
&nbsp;
  <span style="color:#008000; font-style:italic;"># Set this if you want SSL to be enabled on the web server. The SSL cert</span>
  <span style="color:#008000; font-style:italic;"># and key files need to exist on the server, The cert file should be in</span>
  <span style="color:#008000; font-style:italic;"># /etc/ssl/certs/default.pem and the key file should be in</span>
  <span style="color:#008000; font-style:italic;"># /etc/ssl/private/default.key (see :server_config_files_root).</span>
  <span style="color:#ff3333; font-weight:bold;">:enable_ssl</span> =&gt; <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#006600; font-weight:bold;">&#125;</span>
&nbsp;</pre>
<p>Be sure to customize those files and read the comments.</p>
<p>Now run cap -T and you should see all the <a href="http://ec2onrails.rubyforge.org/">ec2onrails</a> tasks like this.</p>
<p>Also, use the hostname “db_primary” in your database.yml file. After running “cap ec2onrails:server:set_roles” it will resolve to the instance defined in your Capistrano “db” role.</p>
<h3>Deploy the site</h3>
<pre class="bash">
cap ec2onrails:setup
cap ec2onrails:db:set_root_password
cap deploy:cold
</pre>
<p>That should be it!  Now goto http://ec2-xxx-xxx-xx-xxx.compute-1.amazonaws.com and your site should be running.</p>
<hr/>
<h2>Extended Set Up</h2>
<p>This was a very basic set up and you will want to customize your installation. </p>
<h3>Cron services</h3>
<p>EC2onrails lets you do hourly and daily cron tasks, but not more frequent<br />
than that. I installed craken and have this in my deploy.rb to compensate:</p>
<pre class="ruby">&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:craken</span> <span style="color:#9966CC; font-weight:bold;">do</span>
	desc <span style="color:#996600;">&quot;Install raketab&quot;</span>
	task <span style="color:#ff3333; font-weight:bold;">:install</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> =&gt; <span style="color:#ff3333; font-weight:bold;">:cron</span> <span style="color:#9966CC; font-weight:bold;">do</span>
		set <span style="color:#ff3333; font-weight:bold;">:rails_env</span>, <span style="color:#996600;">&quot;production&quot;</span> <span style="color:#9966CC; font-weight:bold;">unless</span>
		exists?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:rails_env</span><span style="color:#006600; font-weight:bold;">&#41;</span>
		set <span style="color:#ff3333; font-weight:bold;">:env_args</span>, <span style="color:#006600; font-weight:bold;">&#40;</span>exists?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:env_args</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? env_args :<span style="color:#996600;">&quot;app_name=#{application} deploy_path=#{current_path}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
			run <span style="color:#996600;">&quot;cd #{current_path} &amp;&amp; rake #{env_args} RAILS_ENV=#{rails_env} craken:install&quot;</span>
			<span style="color:#9966CC; font-weight:bold;">end</span>
			task <span style="color:#ff3333; font-weight:bold;">:uninstall</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> =&gt; <span style="color:#ff3333; font-weight:bold;">:cron</span> <span style="color:#9966CC; font-weight:bold;">do</span>
				set <span style="color:#ff3333; font-weight:bold;">:rails_env</span>, <span style="color:#996600;">&quot;production&quot;</span> <span style="color:#9966CC; font-weight:bold;">unless</span> exists?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:rails_env</span><span style="color:#006600; font-weight:bold;">&#41;</span>
				set <span style="color:#ff3333; font-weight:bold;">:env_args</span>, <span style="color:#006600; font-weight:bold;">&#40;</span>exists?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:env_args</span><span style="color:#006600; font-weight:bold;">&#41;</span> ? env_args :<span style="color:#996600;">&quot;app_name=#{application} deploy_path=#{current_path}&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
				run <span style="color:#996600;">&quot;cd #{current_path} &amp;&amp; rake #{env_args} RAILS_ENV=#{rails_env} craken:uninstall; true&quot;</span>
	<span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span>
&nbsp;
before <span style="color:#996600;">&quot;deploy:symlink&quot;</span>, <span style="color:#996600;">&quot;craken:uninstall&quot;</span>
after <span style="color:#996600;">&quot;deploy:symlink&quot;</span>, <span style="color:#996600;">&quot;craken:install&quot;</span>
&nbsp;</pre>
<p>You can see more about the <a href="http://capitate.rubyforge.org/recipes/deploy.html">capistrano events here</a>. The recipe was taken <a href="http://github.com/latimes/craken/blob/5aa07b47cca7eab925fca714a160eedc6164bc20/recipes/craken.rb">from here</a>.</p>
<h2>Gotchas</h2>
<ul>
<li>Don't forget to open up port 443 on Amazon's management console if<br />
  you need ssl support</li>
<li><a href="http://groups.google.com/group/ec2-on-rails-discuss/browse_thread/thread/79b60bf683b2365b">Follow these instructions</a> to configure your SSL certs</li>
<li>Setting up <a href="http://codeintensity.blogspot.com/2009/03/deploying-per-server-crontabs-with.html">cron is described here</a></li>
<li>If you include submodules you can't do the git shallow copy</li>
</ul>
<h2>Useful links</h2>
<ul>
<li><a href="http://ec2onrails.rubyforge.org/">EC2 on Rails</a></li>
<li><a href="http://github.com/guides/deploying-with-capistrano">Getting<br />
 it working with github</a> (has some useful stuff about capistrano)</li>
<li><a<br />
  href="http://kumaria.blogspot.com/2008/12/rails-deployment-capistrano-github.html">Random<br />
  guy talking about what he did</a></li>
<li><a href="https://console.aws.amazon.com/ec2/home">The amazon ec2<br />
  console</a></li>
<li><a<br />
  href="http://www.zabada.com/tutorials/deploying-a-rails-application-to-production-on-amazon-ec2.php">Another<br />
  guy deploys ec2 on rails</a></li>
<li><a href="http://thinkrefresh.com/posts/9-starling-workling-capistrano-tasks">Starling and workling capistrano tasks</a></li>
</ul>
<h2>Advanced - Setting up a db server</h2>
<ul>
<li>Setup a cool mysql server backed by EBS here: <a<br />
href="http://developer.amazonwebservices.com/connect/entry.jspa?categoryID=100&externalID=1663">http://developer.amazonwebservices.com/connect/entry.jspa?categoryID=100&externalID=1663</a></li>
<li>This server only has a root user, but capistrano needs an admin user<br />
that is capable of sudoing...d'oh! You have to do the<br />
following:</li>
</ul>
<pre class="bash">
adduser admin
</pre>
<p>Now, add your public keypair via these instructions here:<br />
<a href="http://blogs.techrepublic.com.com/opensource/?p=86">blogs.techrepublic.com.com</a></p>
<p>I think you have to manually copy the keypair; who knows where it is on<br />
the system??</p>
<p>Now, add the admin user to the /etc/sudoers file so it is what capistrano<br />
is expecting. </p>
<pre class="bash">
# The 'admin' user can run sudo without a password<br/>
admin   ALL=(ALL) NOPASSWD: ALL
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/deploying-a-rails-app-to-amazon-ec2-with-capistrano/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authlogic + BDD Rails example</title>
		<link>http://www.jonathanspooner.com/web-development/ruby-on-rails/authlogic-bdd-rails-example/</link>
		<comments>http://www.jonathanspooner.com/web-development/ruby-on-rails/authlogic-bdd-rails-example/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 17:50:45 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/?p=542</guid>
		<description><![CDATA[Example on github http://github.com/jspooner/authlogic_cucumber_rspec_example
]]></description>
			<content:encoded><![CDATA[<p>Example on github <a href="http://github.com/jspooner/authlogic_cucumber_rspec_example">http://github.com/jspooner/authlogic_cucumber_rspec_example</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/ruby-on-rails/authlogic-bdd-rails-example/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Adio Footwear</title>
		<link>http://www.jonathanspooner.com/web-development/adio-footwear/</link>
		<comments>http://www.jonathanspooner.com/web-development/adio-footwear/#comments</comments>
		<pubDate>Sun, 27 Jul 2008 04:51:07 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[ActionScript 3.0]]></category>
		<category><![CDATA[Content Management System]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Video]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/?p=93</guid>
		<description><![CDATA[Client: Adio Footwear
Work: Flash ActionScript 3.0, SWFAddress, SEO, Ruby on Rails, REST
Link: www.adiofootwear.com
Description:  With SWFAddress at its core this full flash site manages state like a typical html web site.  One of the most interesting patterns in this project is the management of multiple tiers of state and loaded assets.  The admin [...]]]></description>
			<content:encoded><![CDATA[<p>Client: <a href="http://adiofootwear.com">Adio Footwear</a><br />
Work: <a href="http://www.adobe.com/devnet/actionscript/articles/actionscript3_overview.html">Flash ActionScript 3.0</a>, <a href="http://www.asual.com/swfaddress/">SWFAddress</a>, SEO, <a href="http://www.rubyonrails.org/">Ruby on Rails</a>, <a href="http://en.wikipedia.org/wiki/Representational_State_Transfer">REST</a><br />
Link: <a href="http://adiofootwear.com">www.adiofootwear.com</a><br />
Description:  With SWFAddress at its core this full flash site manages state like a typical html web site.  One of the most interesting patterns in this project is the management of multiple tiers of state and loaded assets.  The admin was built with Ruby on Rails, deployed with Capistrano and, served by a cluster of 4 Mongrels.</p>
<p>Results:  In this graph we can see an immediate 25% decrease in the bounce rate.  The orange line shows the bounce rate is know skewed due to an increase of traffic at the site launch.  The blue line shows the drop in the user bounce rate.  I attribute this improvement to the sites navigation improvements.  Visually the navigation is broken up into two consistent visual elements giving the user a familiar tool.  Functionally this site improves the user experience by showing state in the address bar and having working forward/back buttons.   </p>
<p><a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-4.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-4.png" alt="" title="picture-4" width="499" height="63" class="alignleft size-full wp-image-101" /></a></p>
<p>This graph compares the average time on site "Orange" improved by 2 minutes and bounce rate decreasing by 25%.</p>
<p><a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-5.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-5.png" alt="" title="adiofootwear.com" class="alignleft size-full wp-image-108" /></a></p>
<p><a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-2.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-2-300x215.png" alt="" title="adiofootwear.com" width="300" height="215" class="alignleft size-medium wp-image-102" /></a></p>
<p><a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-3.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-3-300x219.png" alt="" title="adiofootwear.com - sean white" width="300" height="219" class="alignleft size-medium wp-image-103" /></a><br />
<a href="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-11.png"><img src="http://www.jonathanspooner.com/blog/wp-content/uploads/2008/08/picture-11-300x215.png" alt="Footwear Page" title="adiofootwear.com" width="300" height="215" class="alignleft size-medium wp-image-106" /></a></p>
<div class="clear"></div>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/adio-footwear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails Videos</title>
		<link>http://www.jonathanspooner.com/web-development/ruby-on-rails-videos/</link>
		<comments>http://www.jonathanspooner.com/web-development/ruby-on-rails-videos/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 18:11:51 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/2008/02/14/ruby-on-rails-videos/</guid>
		<description><![CDATA[I found some funny Apple Commercial spoofs yesterday and wanted to share them.&#160; Apart from being funny they actually help show why Rails is such a great tool.

Embedded Video









Tags: rubyon rails,  video

]]></description>
			<content:encoded><![CDATA[<p>I found some funny Apple Commercial spoofs yesterday and wanted to share them.&nbsp; Apart from being funny they actually help show why Rails is such a great tool.</p>
<p><embed wmode="transparent" type="application/x-shockwave-flash" src="http://www.youtube.com/v/p5EIrSM8dCA" height="350" width="425">
<p class="citation"><cite cite="http://www.railsenvy.com/tags/Commercials"><a href="http://www.railsenvy.com/tags/Commercials">Embedded Video</a></cite></p>
<p><span id="more-78"></span></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/PQbuyKUaKFo&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/PQbuyKUaKFo&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/p5EIrSM8dCA&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/p5EIrSM8dCA&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/Ld919lziKgE&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/Ld919lziKgE&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/528BCJiRkks&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/528BCJiRkks&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/GQXqWkWqnSw&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/GQXqWkWqnSw&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/PLUS00QrYWw&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/PLUS00QrYWw&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/kU-4D51FY98&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/kU-4D51FY98&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object></p>
<p><object height="355" width="425"><param name="movie" value="http://www.youtube.com/v/z99EHyG2jQA&amp;rel=1&amp;border=0"><param name="wmode" value="transparent"><embed src="http://www.youtube.com/v/z99EHyG2jQA&amp;rel=1&amp;border=0" type="application/x-shockwave-flash" wmode="transparent" height="355" width="425"></object><!-- technorati tags begin -->
<p style="font-size:10px;text-align:right;">Tags: <a href="http://technorati.com/tag/rubyon%20rails" rel="tag">rubyon rails</a>, <a href="http://technorati.com/tag/%20video" rel="tag"> video</a></p>
<p><!-- technorati tags end --></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/ruby-on-rails-videos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ImageMagick on OS X 10.4</title>
		<link>http://www.jonathanspooner.com/web-development/imagemagick-on-os-x-104/</link>
		<comments>http://www.jonathanspooner.com/web-development/imagemagick-on-os-x-104/#comments</comments>
		<pubDate>Sun, 13 Jan 2008 17:23:55 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/2008/01/13/imagemagick-on-os-x-104/</guid>
		<description><![CDATA[If you looking to add ImageMagick to your OS X 10.4 machine and your not super familiar with compiling your own binaries use this installer from entropy.  Entropy has two installers for OS X 10.2 and 10.3.  After a morning of trying to build my own binaries I decided to just give the [...]]]></description>
			<content:encoded><![CDATA[<p>If you looking to add ImageMagick to your OS X 10.4 machine and your not super familiar with compiling your own binaries use this installer from entropy.  Entropy has two installers for OS X 10.2 and 10.3.  After a morning of trying to build my own binaries I decided to just give the 10.3 installer a try.  So far it works great with no problems.<br />
<a href="http://www.entropy.ch/software/macosx/#imagemagick">http://www.entropy.ch/software/macosx/#imagemagick</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/imagemagick-on-os-x-104/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ruby on Rails and MediaTemple DV</title>
		<link>http://www.jonathanspooner.com/web-development/ruby-on-rails-and-mediatemple-dv/</link>
		<comments>http://www.jonathanspooner.com/web-development/ruby-on-rails-and-mediatemple-dv/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 01:09:10 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/2007/09/11/ruby-on-rails-and-mediatemple-dv/</guid>
		<description><![CDATA[Okay lets be honest.  10 hours later and this is not my favorite thing to do.  RoR was much easier to get running on the GridServer, which seems to run the apps well.
We purchased the DV for work and it hasn't been the fastest thing to set up.  Here is the article [...]]]></description>
			<content:encoded><![CDATA[<p>Okay lets be honest.  10 hours later and this is not my favorite thing to do.  RoR was much easier to get running on the GridServer, which seems to run the apps well.<br />
We purchased the DV for work and it hasn't been the fastest thing to set up.  Here is the article from the MediaTemple knowledgebase for setting up a <a href="http://kb.mediatemple.net/article.php?id=279">Ruby on Rails with mongrel</a>.  It has you setting up a cluster of mongrels and the process is more difficult than the grid server.  I was also unable to get Capistrano working on the DV.  I found <a href="http://railswatcher.com/2007/6/19/capistrano-2-mongrel_cluster-recipe">this recipe</a> but things get hairy quickly. </p>
<p>Yikes!  I need to find a good solution that is packaged up and ready to go.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/ruby-on-rails-and-mediatemple-dv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Deploying Ruby on Rails</title>
		<link>http://www.jonathanspooner.com/web-development/ruby-on-rails/deploying-ruby-on-rails/</link>
		<comments>http://www.jonathanspooner.com/web-development/ruby-on-rails/deploying-ruby-on-rails/#comments</comments>
		<pubDate>Wed, 12 Sep 2007 01:02:23 +0000</pubDate>
		<dc:creator>Administrator</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://www.jonathanspooner.com/blog/2007/09/11/deploying-ruby-on-rails/</guid>
		<description><![CDATA[Okay so it's been several weeks (5 to be exact) since I tried to deploy the bagoflix.com site.  Originally I was using Dreamhost but soon found that Ruby on Rails needed a little more juice to.  I had a 3 month trial card for MediaTemple and decided to give their Grid Server a [...]]]></description>
			<content:encoded><![CDATA[<p>Okay so it's been several weeks (5 to be exact) since I tried to deploy the bagoflix.com site.  Originally I was using <a href="http://dreamhost.com" target="_blank">Dreamhost</a> but soon found that Ruby on Rails needed a little more juice to.  I had a 3 month trial card for <a href="http://mediatemple.net" target="_blank">MediaTemple</a> and decided to give their Grid Server a try. <a href="http://blog.vixiom.com/2007/02/18/mt-ror-a-z-the-complete-guide-to-getting-rails-running-on-media-temple/" target="_blank">Vixiom</a> was a <strong>big </strong>help getting Ruby on Rails installed on the grid server.  He also helps you install Capistrano which is a wonderful tool to automatically deploy your rails app from SubVersion.  I don't know how to do this yet but Capistrano enables you to roll back to a previous release if something should go wrong.</p>
<p>I have since installed the whole RoR set up on a <a href="http://mediatemple.net" target="_blank">MediaTemple</a> DV server.  The process wasn't that bad.  You can see how to do it <a href="http://kb.mediatemple.net/article.php?id=279" target="_blank">here</a>.  I was able to follow their directions and get it to work first try.</p>
<p>In the mean time I decided to launch a small application on Rails just to get the process down before deploying a larger app.  There's all this talk that it won't scale and crap like that.  I want to see for myself.  So the app is called linkrook.com and it's a simple long url redirect program.  Check it out!</p>
<p>What do I think of Ruby on Rails now?<br />
I still love it.  I'm not a CS guy, just a guy that went to art school and learned ActionScript.  OOP is the way to go and  PHP drives me crazy, it's soo messy.  RoR helps you do things correctly with version control and clean objects... I could go on and on.  Yes it took a bit to get servers set up.  Much of that is because MediaTemple's GridServer has their own mtr commands instead of capistrano.</p>
<p>What Challenge is next?<br />
Getting the <a href="https://rubyforge.org/projects/activerevver/" target="_blank">ActiveRevver</a> Model to work on Rails 1.2.3.  Anyone want to give me any thoughts on how to do so?<br />
My other option is to just use the XML-RPC from <a href="http://developer.revver.com/">Revver</a>.  I'm just not exactly sure how to structure each xml request.  Revver showes the api but I'm just not quite sure how to use the xml-rpc in ruby.  I'll have to investigate more.</p>
<p>Resources I have found<br />
<a href="http://del.icio.us/jspooner/rails" target="_blank">http://del.icio.us/jspooner/rails </a><br />
<a href="http://del.icio.us/jspooner/rails_deploy" target="_blank">http://del.icio.us/jspooner/rails_deploy</a></p>
<p>Big thinks to <a href="http://developer.assaydepot.com/" target="_blank">Chris</a> at <a href="http://developer.assaydepot.com/" target="_blank">Assay Deopt</a> for helping me with Capistrano.  Check out his <a href="http://developer.assaydepot.com/" target="_blank">developer blog</a> for some good RoR stuff.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jonathanspooner.com/web-development/ruby-on-rails/deploying-ruby-on-rails/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
