<?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>Mozketo &#187; Ruby on Rails</title>
	<atom:link href="http://mozketo.com/category/ruby-on-rails/feed/" rel="self" type="application/rss+xml" />
	<link>http://mozketo.com</link>
	<description>Now a dev diary</description>
	<lastBuildDate>Thu, 25 Mar 2010 09:17:59 +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>Phusion Passenger on Ubuntu 9.10</title>
		<link>http://mozketo.com/phusion-passenger-on-ubuntu-9-10/</link>
		<comments>http://mozketo.com/phusion-passenger-on-ubuntu-9-10/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 03:58:52 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=334</guid>
		<description><![CDATA[At first I was thrown by the Phusion Passenger installation instructions when it talked about enabling the Passenger module in apache .conf file. In Ubuntu the enabling/disabling of modules does not sit in a .conf file but, in fact, split into individual .load/.conf files in the /etc/apache2/mods-available folder.
This means when you enable a module with [...]]]></description>
			<content:encoded><![CDATA[<p>At first I was thrown by the Phusion Passenger installation instructions when it talked about enabling the Passenger module in apache .conf file. In Ubuntu the enabling/disabling of modules does not sit in a .conf file but, in fact, split into individual .load/.conf files in the /etc/apache2/mods-available folder.</p>
<p>This means when you enable a module with <code>a2enmod</code> in Ubuntu it simply makes a symlink from mods-enabled -> mods-available and disabling a module (with <code>a2dismod</code> is just as easy. No more hunting in those .conf files.</p>
<p>So I wanted to keep things using the same idea of using the mods-enabled directory as opposed to using one large apache2.conf file.</p>
<h2>Phusion Passenger Installation</h2>
<p>Passenger is drop dead simple to install, here&#8217;s the steps.</p>
<p>Update the system</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p334code7'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3347"><td class="code" id="p334code7"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> update
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> apache2-prefork-dev</pre></td></tr></table></div>

<p>Now Install Phusion Passenger</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p334code8'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3348"><td class="code" id="p334code8"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> passenger
<span style="color: #c20cb9; font-weight: bold;">sudo</span> passenger-install-apache2-module</pre></td></tr></table></div>

<p>Passenger is now installed; let&#8217;s get it enabled.</p>
<h2>Create the .load/.conf in mod-available</h2>
<p>Create the .load file with <code>sudo nano /etc/apache2/mods-available/passenger.load</code> and paste in the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p334code9'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p3349"><td class="code" id="p334code9"><pre class="text" style="font-family:monospace;">LoadModule passenger_module /usr/lib/ruby/gems/1.8/gems/passenger-2.2.9/ext/apache2/mod_passenger.so</pre></td></tr></table></div>

<p>Note: The version numbers I&#8217;ve used might not be what you have installed; Passenger will give you the correct version numbers on screen once installation is complete.</p>
<p>Create the .conf file with <code>sudo nano /etc/apache2/mods-available/passenger.conf</code> and paste in the following:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p334code10'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33410"><td class="code" id="p334code10"><pre class="text" style="font-family:monospace;">&lt;IfModule passenger_module&gt;
   PassengerRoot /usr/lib/ruby/gems/1.8/gems/passenger-2.2.9
   PassengerRuby /usr/bin/ruby1.8
&lt;/IfModule&gt;</pre></td></tr></table></div>

<h2>Enable Passenger</h2>
<p>Enabling Passenger is as simple as:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p334code11'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33411"><td class="code" id="p334code11"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> a2enmod passenger
<span style="color: #c20cb9; font-weight: bold;">sudo</span> <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>init.d<span style="color: #000000; font-weight: bold;">/</span>apache2 restart</pre></td></tr></table></div>

<p>And you will need to change your <code>/etc/apache2/sites-available/default</code> to read:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p334code12'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p33412"><td class="code" id="p334code12"><pre class="text" style="font-family:monospace;">&lt;VirtualHost *:80&gt;
    ServerName www.rackapp.com
    DocumentRoot /webapps/rackapp/public
&lt;/VirtualHost&gt;</pre></td></tr></table></div>

<p>And you&#8217;re done. You&#8217;re up and running with Phusion Passenger.</p>
<p>You can read more about configuring Passenger <a href="http://www.modrails.com/documentation/Users%20guide.html">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/phusion-passenger-on-ubuntu-9-10/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Capistrano without SCM</title>
		<link>http://mozketo.com/capistrano-without-scm/</link>
		<comments>http://mozketo.com/capistrano-without-scm/#comments</comments>
		<pubDate>Mon, 15 Feb 2010 11:39:30 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=325</guid>
		<description><![CDATA[I am unable to get Capistrano to deploy from our Subversion repository as it&#8217;s on a local IP, with no VPN access or access from the outside world and I&#8217;m also not in a position to open up the SVN box to the outside world.
So how does Capistrano get access to the source code? 
Turns [...]]]></description>
			<content:encoded><![CDATA[<p>I am unable to get Capistrano to deploy from our Subversion repository as it&#8217;s on a local IP, with no VPN access or access from the outside world and I&#8217;m also not in a position to open up the SVN box to the outside world.</p>
<p>So how does Capistrano get access to the source code? </p>
<p>Turns out it&#8217;s not that hard, you just need to know the tricks. So open up your /config/deploy.rb file and add/modify the following lines:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p325code18'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32518"><td class="code" id="p325code18"><pre class="text" style="font-family:monospace;">set :scm, :none
set :respository, &quot;.&quot;
set :deploy_via, :copy</pre></td></tr></table></div>

<h2>Using Capistrano</h2>
<p>Here&#8217;s my notes for getting Capistrano up and running. You need only run these steps the first time:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p325code19'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32519"><td class="code" id="p325code19"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">sudo</span> gem <span style="color: #c20cb9; font-weight: bold;">install</span> Capistrano
<span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>your<span style="color: #000000; font-weight: bold;">/</span>project<span style="color: #000000; font-weight: bold;">/</span>directory
capify .</pre></td></tr></table></div>

<p>copy deploy.rb (listed below) over project/config/deploy.rb</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p325code20'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32520"><td class="code" id="p325code20"><pre class="bash" style="font-family:monospace;">cap deploy:setup
cap deploy:cold</pre></td></tr></table></div>

<p>Subsequent Capistrano usage needs only:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p325code21'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32521"><td class="code" id="p325code21"><pre class="bash" style="font-family:monospace;">cap deploy</pre></td></tr></table></div>

<h2>deploy.rb</h2>
<p>Below is the deploy.rb I&#8217;ve used (many thanks to <a href="http://twitter.com/aussiegeek">aussiegeek on twitter</a>). You might not require the first line <code>default_run_options[:pty] = true</code> I had to add it for use on Ubuntu 9.10.</p>
<p>Also I&#8217;m using Phusion Passenger.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p325code22'); return false;">View Code</a> TEXT</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p32522"><td class="code" id="p325code22"><pre class="text" style="font-family:monospace;">default_run_options[:pty] = true
&nbsp;
set :application, 'projectName'
set :deploy_to, '/server/path/'
set :user, 'username'
set :use_sudo, false
&nbsp;
role :web, &quot;server.com&quot;
role :db, &quot;server.com&quot;, :primary =&gt; true
role :app, &quot;server.com&quot;
&nbsp;
set :scm, :none
set :repository, &quot;.&quot;
set :deploy_via, :copy
&nbsp;
namespace :deploy do
  task :start, :roles =&gt; :app do
  end
&nbsp;
  task :stop, :roles =&gt; :app do
  end
&nbsp;
  task :restart, :roles =&gt; :app do
    run &quot;touch #{current_path}/tmp/restart.txt&quot;
  end
end</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/capistrano-without-scm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing Ruby on Rails on Ubuntu Karmic Koala</title>
		<link>http://mozketo.com/installing-ruby-on-rails-on-ubuntu-karmic-koala/</link>
		<comments>http://mozketo.com/installing-ruby-on-rails-on-ubuntu-karmic-koala/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 23:15:32 +0000</pubDate>
		<dc:creator>Mozketo</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>

		<guid isPermaLink="false">http://mozketo.com/?p=299</guid>
		<description><![CDATA[Here&#8217;s the steps I took to install Ruby on Rails on a fresh Ubuntu 9.10 Karmic Koala.
Update/upgrade system
sudo apt-get update
Install ruby, irb and rdoc
sudo apt-get install ruby irb rdoc
Install required Ubuntu packages
sudo apt-get install libopenssl-ruby build-essential ruby1.8-dev libpq-dev
Install rubygems
wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz
tar -xvzf rubygems-1.3.5.tgz
cd rubygems-1.3.5/
sudo ruby setup.rb
sudo gem update --system
Install Rails (with gem)
sudo gem install rails
If you [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the steps I took to install Ruby on Rails on a fresh Ubuntu 9.10 Karmic Koala.</p>
<h3>Update/upgrade system</h3>
<p><code>sudo apt-get update</code></p>
<h3>Install ruby, irb and rdoc</h3>
<p><code>sudo apt-get install ruby irb rdoc</code></p>
<h3>Install required Ubuntu packages</h3>
<p><code>sudo apt-get install libopenssl-ruby build-essential ruby1.8-dev libpq-dev</code></p>
<h3>Install rubygems</h3>
<p><code>wget http://rubyforge.org/frs/download.php/60718/rubygems-1.3.5.tgz<br />
tar -xvzf rubygems-1.3.5.tgz<br />
cd rubygems-1.3.5/<br />
sudo ruby setup.rb<br />
sudo gem update --system</code></p>
<h3>Install Rails (with gem)</h3>
<p><code>sudo gem install rails</code></p>
<h3>If you need to install postgresql</h3>
<p><code>sudo apt-get install postgresql</code></p>
<p>Create the postgres user<br />
<code>sudo su postgres<br />
createuser <username></code></p>
<p>Need to create a postgres database?<br />
<code>createdb <db_name></code></p>
<h3>Install the ruby to postgres driver</h3>
<p><code>sudo gem install postgres</code></p>
<h3>Finished</h3>
<p>That&#8217;s it, Ruby on Rails should be installed along with Postgresql if you need it.</p>
<p>Credit goes to <a href="http://vandenabeele.com/Rails-on-Ubuntu-Jaunty">Peter Vandenabeele</a> for the basis for these steps.</p>
]]></content:encoded>
			<wfw:commentRss>http://mozketo.com/installing-ruby-on-rails-on-ubuntu-karmic-koala/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
