<?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>ideas.each &#38;:post &#187; deployment</title>
	<atom:link href="http://blog.tobiascrawley.net/tag/deployment/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.tobiascrawley.net</link>
	<description>Another not so cleverly named blog mostly about software.</description>
	<lastBuildDate>Wed, 17 Feb 2010 14:25: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>Notify a Campfire room on cap deploy</title>
		<link>http://blog.tobiascrawley.net/2009/10/08/notify-a-campfire-room-on-cap-deploy/</link>
		<comments>http://blog.tobiascrawley.net/2009/10/08/notify-a-campfire-room-on-cap-deploy/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 14:26:11 +0000</pubDate>
		<dc:creator>Tobias</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[campfire]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[tips]]></category>

		<guid isPermaLink="false">http://blog.tobiascrawley.net/?p=224</guid>
		<description><![CDATA[We use Campfire for internal communication, and I&#8217;ve lately been pushing notifications there for all to see (Zendesk ticket updates, git repo pushes, etc). We decided it would be useful for the support team to know when a deployment occurs. I googled a bit to see if anyone had shared a Capistrano recipe, and did [...]]]></description>
			<content:encoded><![CDATA[<p>We use <a href="http://campfirenow.com">Campfire</a> for internal communication, and I&#8217;ve lately been pushing notifications there for all to see (<a href="http://zendesk.com">Zendesk</a> ticket updates, git repo pushes, etc). We decided it would be useful for the support team to know when a deployment occurs. I googled a bit to see if anyone had shared a <a href="http://capify.org">Capistrano</a> recipe, and did not find one. So I&#8217;m sharing mine.</p>

<p>Using the <a href="http://github.com/collectiveidea/tinder">tinder</a> gem, its super easy:<br />
<script src="http://gist.github.com/205055.js"></script></p>

<p>Enjoy!</p>]]></content:encoded>
			<wfw:commentRss>http://blog.tobiascrawley.net/2009/10/08/notify-a-campfire-room-on-cap-deploy/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>server_remote gem</title>
		<link>http://blog.tobiascrawley.net/2009/03/31/server_remote-gem/</link>
		<comments>http://blog.tobiascrawley.net/2009/03/31/server_remote-gem/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 18:47:47 +0000</pubDate>
		<dc:creator>Tobias</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[gems]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[simplecli]]></category>

		<guid isPermaLink="false">http://blog.tobiascrawley.net/?p=187</guid>
		<description><![CDATA[I just re-released my server_remote plugin as a gem server_remote on github. I converted it to a gem to make it easier to use in multiple apps, and to make it easier to update (see here for the blog entry on the (now obselete) plugin). 

It is a gem that provides support for running commands [...]]]></description>
			<content:encoded><![CDATA[<p>I just re-released my server_remote plugin as a gem <a href="http://github.com/tobias/server_remote">server_remote</a> on github. I converted it to a gem to make it easier to use in multiple apps, and to make it easier to update (see <a href="http://blog.tobiascrawley.net/2009/01/10/server_remote-a-rails-plugin-for-easily-accessing-servers/">here</a> for the blog entry on the (now obselete) plugin). </p>

It is a gem that provides support for running commands on remote server. Once set up, it provides commands via <code>script/remote</code>:<br />
<ul>
  <li><code>remote shell</code> &#8211; same as ssh&#8217;ing to the server (this is the default command, so it can be called with just <code>remote</code>)</li>
  <li><code>remote console</code> &#8211; executes a <code>script/console</code> on the server</li>
  <li><code>remote logtail</code> &#8211; executes <code>tail -f log/&lt;environment&gt;.log</code> on the server</li>
  <li><code>remote cmd &lt;some command&gt;</code> executes command on the server, displaying the result. It <code>cd</code>&#8217;s to the remote app root first.</li>
  <li><code>remote scp &lt;local_file&gt; :&lt;remote_file&gt;</code> provides scp. Prefix remote files with &#8216;:&#8217;</li></ul>Configuration is in <code>config/server_remote.yml</code>, and is grouped into <em>profiles</em>. 

<p>Here is the output of <code>remote usage</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">Executes commands on a remote server over ssh. Configuration is in:
/Users/tobias/customers/DealerIgnition/dealer_ignition/script/../config/server_remote.yml
&nbsp;
You can override the profile used with -p profile. The default profile is: app
&nbsp;
Learn more in the readme:
/opt/local/lib/ruby/gems/1.8/gems/tobias-server_remote-0.2.0/lib/server_remote/../../README.textile
&nbsp;
remote commands are:
&nbsp;
    DEFAULT COMMAND   shell
&nbsp;
    cmd               executes an arbitrary command on the server after a cd to the app path
    commands          List all 'remote' commands
    console           executes remote console
    help              Provide help documentation for a command
    logtail           executes remote tail -f on the log
    scp               copies files over scp (prefix remote files with ':')
    shell             executes remote shell
    usage             prints usage message
&nbsp;
For help on a particular command, use 'remote help COMMAND'.</pre></div></div>




<p>It uses <a href="http://remi.org">remi&#8217;s</a> <a href="http://github.com/remi/simplecli">simplecli</a> gem. </p>

<p>I plan to add other commands as needed, or you can open up <code>Remote::Commands</code> and add your own. </p>

<h3>Installation</h3>

<p>You will need to install the gem (only once), then setup any apps where you want to use it.</p>



<pre>
  sudo gem install tobias-server_remote --source http://gems.github.com/
  server_remotify path_to_app
</pre>]]></content:encoded>
			<wfw:commentRss>http://blog.tobiascrawley.net/2009/03/31/server_remote-gem/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>server_remote &#8211; A Rails plugin for easily accessing servers</title>
		<link>http://blog.tobiascrawley.net/2009/01/10/server_remote-a-rails-plugin-for-easily-accessing-servers/</link>
		<comments>http://blog.tobiascrawley.net/2009/01/10/server_remote-a-rails-plugin-for-easily-accessing-servers/#comments</comments>
		<pubDate>Sat, 10 Jan 2009 22:19:20 +0000</pubDate>
		<dc:creator>Tobias</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[rails]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[simplecli]]></category>

		<guid isPermaLink="false">http://blog.handbuiltsoftware.com/?p=102</guid>
		<description><![CDATA[
  Note: this post is out of date. This tool is now a gem instead of a plugin; read all about it here.

I just released server_remote on github. It is a plugin for connecting to remote servers. Once installed, it provides commands via script/remote:
* remote shell &#8211; same as ssh&#8217;ing to the server (this [...]]]></description>
			<content:encoded><![CDATA[<div style="background-color: #ffc;border: 1px solid #777;padding: 12px;font-size:1.5em;text-align: center;line-height: 1.2em;">
  <strong>Note:</strong> this post is out of date. This tool is now a gem instead of a plugin; read all about it <a href="http://blog.tobiascrawley.net/2009/03/31/server_remote-gem/">here</a>.<br />
</div>
I just released <a href="http://github.com/tobias/server_remote">server_remote</a> on github. It is a plugin for connecting to remote servers. Once installed, it provides commands via <code>script/remote</code>:<br />
* <code>remote shell</code> &#8211; same as ssh&#8217;ing to the server (this is the default command, so it can be called with just <code>remote</code>)<br />
* <code>remote console</code> &#8211; executes a <code>script/console</code> on the server<br />
* <code>remote logtail</code> &#8211; executes <code>tail -f log/&lt;environment&gt;.log</code> on the server

<p>Configuration is in <code>config/server_remote.yml</code>, and is grouped into <em>profiles</em>. </p>

<p>Here is the output of <code>remote usage</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;"> Executes commands on a remote server over ssh. Configuration is in:
 /Users/tobias/customers/DropZite/restaurantZite/config/server_remote.yml
&nbsp;
 You can override the profile used with -p profile. The default profile is: app
&nbsp;
 Learn more in the readme:
 /Users/tobias/customers/DropZite/restaurantZite/vendor/plugins/server_remote/lib/README.textile
&nbsp;
 remote commands are:
&nbsp;
    DEFAULT COMMAND   shell
&nbsp;
    commands          List all 'remote' commands
    console           executes remote console
    help              Provide help documentation for a command
    logtail           executes remote tail -f on the log
    shell             executes remote shell
    usage             prints usage message
&nbsp;
 For help on a particular command, use 'remote help COMMAND'.</pre></div></div>




<p>It uses <a href="http://remi.org">remi&#8217;s</a> <a href="http://github.com/remi/simplecli">simplecli</a> gem. <br />
<br/><br />
I plan to add other commands as needed, or you can open up <code>Remote::Commands</code> and add your own. Install with: <code>script/plugin install git://github.com/tobias/server_remote.git</code></p>]]></content:encoded>
			<wfw:commentRss>http://blog.tobiascrawley.net/2009/01/10/server_remote-a-rails-plugin-for-easily-accessing-servers/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Stepping off the Rails &#8211; adventures with Sinatra (Part 2)</title>
		<link>http://blog.tobiascrawley.net/2008/12/21/stepping-off-the-rails-part-2/</link>
		<comments>http://blog.tobiascrawley.net/2008/12/21/stepping-off-the-rails-part-2/#comments</comments>
		<pubDate>Sun, 21 Dec 2008 17:41:34 +0000</pubDate>
		<dc:creator>Tobias</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[dreamhost]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[sinatra]]></category>
		<category><![CDATA[urlunwind]]></category>

		<guid isPermaLink="false">http://blog.handbuiltsoftware.com/?p=54</guid>
		<description><![CDATA[In this episode, our trusty adventurer actually runs his Sinatra app, and deploys it to Passenger on shared hosting. See Part 1 for details of building the application.

Launching locally: two ways to skin a cat

I realized that in Part 1 I did not cover launching the app to hit it from the browser. It&#8217;s easy! [...]]]></description>
			<content:encoded><![CDATA[<p><em>In this episode, our trusty adventurer actually runs his Sinatra app, and deploys it to Passenger on shared hosting. See <a href="http://blog.handbuiltsoftware.com/2008/12/18/stepping-off-the-rails-part-1/">Part 1</a> for details of building the application.</em></p>

<h3>Launching locally: two ways to skin a cat</h3>

<p>I realized that in <a href="http://blog.handbuiltsoftware.com/2008/12/18/stepping-off-the-rails-part-1/">Part 1</a> I did not cover launching the app to hit it from the browser. It&#8217;s easy! To launch the app, use <code>ruby app_name.rb</code>. This will fire up a mongrel instance on port <code>4567</code> for your viewing pleasure. </p>

<p>Once you have defined your rack configuration (see below), you can also run the app inside rack locally with <code>rackup config.ru</code> to test your rack settings. This will launch rack inside mongrel on port <code>9292</code>. Thanks to @jnunemaker for the <a href="http://railstips.org/2008/12/15/deploying-sinatra-on-dreamhost-with-passenger">tip</a>. In fact, John&#8217;s article is what I used as a basis for my deployment, with a few changes to support file based view templates.</p>

<h3>Rack Configuration</h3>

<p>To configure the application to run on rack under Passenger, you need to define a rack configuration file. Passenger expects that file to be named <code>config.ru</code> (see <a href="http://www.modrails.com/documentation/Users%20guide.html#_deploying_a_rack_based_ruby_application">Deploying a Rack-based Ruby application</a> in the Passenger documentation). Here is a minimum <code>config.ru</code> to run the application:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'sinatra'</span>
&nbsp;
disable <span style="color:#ff3333; font-weight:bold;">:run</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'urlunwind.rb'</span>
run Sinatra.<span style="color:#9900CC;">application</span></pre></div></div>





<p>The only real configuration there is <code>disable :run</code>. This prevents Sinatra from starting a mongrel on port <code>4567</code> when the app file is required. This configuration would work for an app that uses no file based templates, and does not reference anything in <code>public/</code>. If you run this config with rackup on url_unwind (<code>rackup config.ru</code>), you&#8217;ll see errors like:</p>

<p><code>Errno::ENOENT: No such file or directory - /opt/local/bin/views/index.haml</code><br />
<br/><br />
<br/><br />
This is because rack by default sets its base directory to be the path to the called executable (and on my machine, <code>rackup</code> lives in <code>/opt/local/bin/</code>). So we&#8217;ll need to explicitly set the paths:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'sinatra'</span>
&nbsp;
disable <span style="color:#ff3333; font-weight:bold;">:run</span>
set <span style="color:#ff3333; font-weight:bold;">:views</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/views'</span>
set <span style="color:#ff3333; font-weight:bold;">:public</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/public'</span>
set <span style="color:#ff3333; font-weight:bold;">:app_file</span>, <span style="color:#0000FF; font-weight:bold;">__FILE__</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'urlunwind.rb'</span>
run Sinatra.<span style="color:#9900CC;">application</span></pre></div></div>




<p>Now the app should run properly with <code>rackup</code>. </p>

<h3>Logging</h3>

<p>Sinatra uses rack&#8217;s built in logging to log requests, and these log messages get printed to standard out. It would be nice to log these to a file, and we can do that as well in <code>config.ru</code> (based on <a href="http://www.gittr.com/index.php/archive/logging-with-sinatra-and-passenger-another-try/">this tip</a> from Chris Schneider). We&#8217;ll also need to turn error raising back on, since by default Sinatra swallows errors in production mode:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'sinatra'</span>
&nbsp;
disable <span style="color:#ff3333; font-weight:bold;">:run</span>
set <span style="color:#ff3333; font-weight:bold;">:env</span>, <span style="color:#ff3333; font-weight:bold;">:production</span>
set <span style="color:#ff3333; font-weight:bold;">:raise_errors</span>, <span style="color:#0000FF; font-weight:bold;">true</span>
set <span style="color:#ff3333; font-weight:bold;">:views</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/views'</span>
set <span style="color:#ff3333; font-weight:bold;">:public</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/public'</span>
set <span style="color:#ff3333; font-weight:bold;">:app_file</span>, <span style="color:#0000FF; font-weight:bold;">__FILE__</span>
&nbsp;
log = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;log/sinatra.log&quot;</span>, <span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
STDOUT.<span style="color:#9900CC;">reopen</span><span style="color:#006600; font-weight:bold;">&#40;</span>log<span style="color:#006600; font-weight:bold;">&#41;</span>
STDERR.<span style="color:#9900CC;">reopen</span><span style="color:#006600; font-weight:bold;">&#40;</span>log<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'urlunwind.rb'</span>
run Sinatra.<span style="color:#9900CC;">application</span></pre></div></div>





<p>This allows you to add your own logging messages as well, just <code>puts</code>, <code>print</code>, or <code>p@ whatever you want to log. *Note:* you will need to create the @log/</code> directory for this to work.</p>

<h3>Deploy with Capistrano</h3>

<p>I used Capistrano to deploy to Dreamhost, and based my Capfile of off John&#8217;s directions <a href="http://railstips.org/2008/12/15/deploying-sinatra-on-dreamhost-with-passenger">here</a>. I modified it a bit to pull from github, and to create the <code>tmp/</code> and <code>log/</code> directories if they do not exist. Here is my Capfile:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#008000; font-style:italic;">#-*-ruby-*-</span>
<span style="color:#CC0066; font-weight:bold;">load</span> <span style="color:#996600;">'deploy'</span> <span style="color:#9966CC; font-weight:bold;">if</span> respond_to?<span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#ff3333; font-weight:bold;">:namespace</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#008000; font-style:italic;"># cap2 differentiator</span>
&nbsp;
default_run_options<span style="color:#006600; font-weight:bold;">&#91;</span><span style="color:#ff3333; font-weight:bold;">:pty</span><span style="color:#006600; font-weight:bold;">&#93;</span> = <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># be sure to change these</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">'app_user'</span>
set <span style="color:#ff3333; font-weight:bold;">:domain</span>, <span style="color:#996600;">'urlunwind.com'</span>
set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">'url_unwind'</span>
set <span style="color:#ff3333; font-weight:bold;">:git_path_prefix</span>, <span style="color:#996600;">&quot;git@github.com/tobias/&quot;</span>
&nbsp;
<span style="color:#008000; font-style:italic;"># the rest should be good</span>
set <span style="color:#ff3333; font-weight:bold;">:repository</span>, <span style="color:#996600;">&quot;#{git_path_prefix}#{application}.git&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/home/#{user}/#{domain}&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_via</span>, <span style="color:#ff3333; font-weight:bold;">:remote_cache</span>
set <span style="color:#ff3333; font-weight:bold;">:scm</span>, <span style="color:#996600;">'git'</span>
set <span style="color:#ff3333; font-weight:bold;">:branch</span>, <span style="color:#996600;">'master'</span>
<span style="color:#008000; font-style:italic;">#set :git_shallow_clone, 1</span>
set <span style="color:#ff3333; font-weight:bold;">:scm_verbose</span>, <span style="color:#0000FF; font-weight:bold;">true</span>
set <span style="color:#ff3333; font-weight:bold;">:use_sudo</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
&nbsp;
server domain, <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#ff3333; font-weight:bold;">:web</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  task <span style="color:#ff3333; font-weight:bold;">:restart</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    run <span style="color:#996600;">&quot;test -d #{current_path}/tmp || mkdir #{current_path}/tmp&quot;</span>
    run <span style="color:#996600;">&quot;test -d #{current_path}/log || mkdir #{current_path}/log&quot;</span>
    run <span style="color:#996600;">&quot;touch #{current_path}/tmp/restart.txt&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
<span style="color:#9966CC; font-weight:bold;">end</span></pre></div></div>





<p>Since the Sinatra gem is not installed on Dreamhost, I put it in <code>vendor/</code> within the app. Since it is not a gem, it must be required with the full path to the base <code>.rb</code> file, both in <code>config.ru</code> and in the app file itself (<code>urlunwind.rb</code> in this case). Here is the final <code>config.ru</code>:</p>


<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;"><span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'rubygems'</span>
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'vendor/sinatra/lib/sinatra.rb'</span>
&nbsp;
disable <span style="color:#ff3333; font-weight:bold;">:run</span>
set <span style="color:#ff3333; font-weight:bold;">:env</span>, <span style="color:#ff3333; font-weight:bold;">:production</span>
set <span style="color:#ff3333; font-weight:bold;">:raise_errors</span>, <span style="color:#0000FF; font-weight:bold;">true</span>
set <span style="color:#ff3333; font-weight:bold;">:views</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/views'</span>
set <span style="color:#ff3333; font-weight:bold;">:public</span>, <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">dirname</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#0000FF; font-weight:bold;">__FILE__</span><span style="color:#006600; font-weight:bold;">&#41;</span> <span style="color:#006600; font-weight:bold;">+</span> <span style="color:#996600;">'/public'</span>
set <span style="color:#ff3333; font-weight:bold;">:app_file</span>, <span style="color:#0000FF; font-weight:bold;">__FILE__</span>
&nbsp;
log = <span style="color:#CC00FF; font-weight:bold;">File</span>.<span style="color:#9900CC;">new</span><span style="color:#006600; font-weight:bold;">&#40;</span><span style="color:#996600;">&quot;log/sinatra.log&quot;</span>, <span style="color:#996600;">&quot;a&quot;</span><span style="color:#006600; font-weight:bold;">&#41;</span>
STDOUT.<span style="color:#9900CC;">reopen</span><span style="color:#006600; font-weight:bold;">&#40;</span>log<span style="color:#006600; font-weight:bold;">&#41;</span>
STDERR.<span style="color:#9900CC;">reopen</span><span style="color:#006600; font-weight:bold;">&#40;</span>log<span style="color:#006600; font-weight:bold;">&#41;</span>
&nbsp;
<span style="color:#CC0066; font-weight:bold;">require</span> <span style="color:#996600;">'urlunwind.rb'</span>
run Sinatra.<span style="color:#9900CC;">application</span></pre></div></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.tobiascrawley.net/2008/12/21/stepping-off-the-rails-part-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
