<?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>Harchiblog</title>
	<atom:link href="http://www.harchiblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.harchiblog.com</link>
	<description></description>
	<lastBuildDate>Tue, 06 Mar 2012 15:01:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Manage multiple Ruby versions with Phusion Passenger</title>
		<link>http://www.harchiblog.com/2011/04/23/manage-multiple-ruby-versions-with-phusion-passenger/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=manage-multiple-ruby-versions-with-phusion-passenger</link>
		<comments>http://www.harchiblog.com/2011/04/23/manage-multiple-ruby-versions-with-phusion-passenger/#comments</comments>
		<pubDate>Sat, 23 Apr 2011 11:36:14 +0000</pubDate>
		<dc:creator>chok</dc:creator>
				<category><![CDATA[Passengers]]></category>
		<category><![CDATA[Rails 3]]></category>

		<guid isPermaLink="false">http://localhost/kiki/?p=4</guid>
		<description><![CDATA[The context I want to launch many passenger with many version of ruby installed and with différent gemset, etc&#8230; RVM is a part of the solution but can&#8217;t allow to execute different version of passenger. The problem I want to &#8230; <a href="http://www.harchiblog.com/2011/04/23/manage-multiple-ruby-versions-with-phusion-passenger/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>The context</h2>
<p>
  I want to launch many passenger with many version of ruby installed and with différent gemset, etc&#8230; RVM  is a part of the solution but can&#8217;t allow to execute different version of passenger.
</p>
<h2>The problem</h2>
<p>
  I want to find a way to use passenger with many version of rails and many versions of ruby. For the first problem we can use bundler but for the second, it is a problem. If we want use many ruby versions, passenger recommand this way : http://blog.phusion.nl/2010/09/21/phusion-passenger-running-multiple-ruby-versions/ . So We can see that passenger team say we can use passenger as standalone and launch each instance as daemon. It is quite easy but the problem if your server crash or anything else you have to relaunch each instance of passenger by hand. It&#8217;s so boring&#8230;
</p>
<h2>The solution</h2>
<p>
  Here is a script which allow to centralize the execution of daemons. You can find <a href="https://gitorious.org/passengers/passengers" title="passengers">passengers on Gitorious</a>.
</p>
<p>
  You have to specify configuration in /etc/passenger-projects like this :</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;height:300px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap">;Config sample <span style="color: #000000; font-weight: bold;">for</span> passengers<br />
;Default path <span style="color: #000000; font-weight: bold;">for</span> this config file: <span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>passenger-project<br />
;You can customize this path <span style="color: #000000; font-weight: bold;">in</span> the passengers script <span style="color: #7a0874; font-weight: bold;">&#40;</span>CONFIG_FILE<span style="color: #7a0874; font-weight: bold;">&#41;</span><br />
<br />
<span style="color: #7a0874; font-weight: bold;">&#91;</span>project_name<span style="color: #7a0874; font-weight: bold;">&#93;</span><br />
;required parameters<br />
<span style="color: #007800;">path</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>the<span style="color: #000000; font-weight: bold;">/</span>project<br />
<br />
;optional parameters<br />
;- user - default: <span style="color: #ff0000;">'passenger'</span><br />
<span style="color: #007800;">user</span>=my_user<br />
<br />
;- <span style="color: #c20cb9; font-weight: bold;">env</span> - default: production<br />
<span style="color: #007800;">env</span>=my_env<br />
<br />
;- socket_path - default: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>passenger<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>project_name<span style="color: #7a0874; font-weight: bold;">&#93;</span>.socket<br />
<span style="color: #007800;">socket_path</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>file.socket<br />
<br />
;- pid_path - default: <span style="color: #000000; font-weight: bold;">/</span>var<span style="color: #000000; font-weight: bold;">/</span>run<span style="color: #000000; font-weight: bold;">/</span>passenger<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#91;</span>project_name<span style="color: #7a0874; font-weight: bold;">&#93;</span>.pid<br />
<span style="color: #007800;">pid_path</span>=<span style="color: #000000; font-weight: bold;">/</span>path<span style="color: #000000; font-weight: bold;">/</span>to<span style="color: #000000; font-weight: bold;">/</span>file.pid<br />
<br />
;- gemset - add this to use rvm with a specific gemset or ruby version<br />
<span style="color: #007800;">gemset</span>=1.9.2<span style="color: #000000; font-weight: bold;">@</span>mygemset</div></td></tr></tbody></table></div>
</p>
<p>
  You can now use the script :</p>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>passengers start</div></td></tr></tbody></table></div>
<div class="codecolorer-container bash twitlight" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="bash codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #666666;">$ </span>passengers start gitorious</div></td></tr></tbody></table></div>
<p>&#8230;
</p>
<p>
  The allowed action are &#8220;start, stop, status&#8221;. You can start, stop each daemon automatically
</p>
<p>Hope this can helps others <img src='http://www.harchiblog.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.harchiblog.com/2011/04/23/manage-multiple-ruby-versions-with-phusion-passenger/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

