<?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>Cristian Livadaru's blog &#187; HowTo</title>
	<atom:link href="http://cristian.livadaru.net/category/howto/feed/" rel="self" type="application/rss+xml" />
	<link>http://cristian.livadaru.net</link>
	<description>... think again ...</description>
	<lastBuildDate>Sat, 28 Aug 2010 19:47:23 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>[HowTo] Installing Ruby Enterprise Edition and Passenger on Debian Etch</title>
		<link>http://cristian.livadaru.net/2009/01/12/howto-installing-ruby-enterprise-edition-and-passenger-on-debian-etch/</link>
		<comments>http://cristian.livadaru.net/2009/01/12/howto-installing-ruby-enterprise-edition-and-passenger-on-debian-etch/#comments</comments>
		<pubDate>Mon, 12 Jan 2009 14:22:46 +0000</pubDate>
		<dc:creator>Cristian Livadaru</dc:creator>
				<category><![CDATA[HowTo]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[ruby on rails]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[debuan]]></category>

		<guid isPermaLink="false">http://cristian.livadaru.net/?p=593</guid>
		<description><![CDATA[Install some stuff we will need apt-get install build-essential apache2 ruby1.8 zlib1g-dev libssl-dev mysql-server mysql-common libmysqlclient15-dev libmysqlclient15off apache2-prefork-dev Create a link for ruby else the installer won&#8217;t work ln -s /usr/bin/ruby1.8 /usr/bin/ruby get Ruby Enterprise edition (http://www.rubyenterpriseedition.com/download.html) tar xzvf ruby-enterprise-X.X.X.tar.gz ./ruby-enterprise-X.X.X/installer Delete the Ruby link and create new links rm /usr/bin/ruby ln -s /opt/ruby-enterprise-1.8.6-20081215/bin/rake /usr/bin/rake [...]]]></description>
			<content:encoded><![CDATA[<p>Install some stuff we will need</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> build-essential apache2 ruby1.8 zlib1g-dev libssl-dev mysql-server mysql-common libmysqlclient15-dev libmysqlclient15off apache2-prefork-dev</pre></div></div>

<p>Create a link for ruby else the installer won&#8217;t work</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby1.8 <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby</pre></div></div>

<p>get Ruby Enterprise edition (http://www.rubyenterpriseedition.com/download.html)</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">tar</span> xzvf ruby-enterprise-X.X.X.tar.gz
.<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-X.X.X<span style="color: #000000; font-weight: bold;">/</span>installer</pre></div></div>

<p>Delete the Ruby link and create new links</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rake
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem 
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rails <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>rails
<span style="color: #c20cb9; font-weight: bold;">ln</span> <span style="color: #660033;">-s</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby <span style="color: #000000; font-weight: bold;">/</span>usr<span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby</pre></div></div>

<p>Install Passenger</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>passenger-install-apache2-module</pre></div></div>

<p>if you have this error</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>gems<span style="color: #000000; font-weight: bold;">/</span>passenger-2.0.6
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby <span style="color: #660033;">-S</span> rake clean apache2
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>ruby: No such <span style="color: #c20cb9; font-weight: bold;">file</span> or directory <span style="color: #660033;">--</span> rake <span style="color: #7a0874; font-weight: bold;">&#40;</span>LoadError<span style="color: #7a0874; font-weight: bold;">&#41;</span></pre></div></div>

<p>then it looks like the Rake GEM was not installed, just install it now. and don&#8217;t forget to create the symlink in /usr/bin !</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>bin<span style="color: #000000; font-weight: bold;">/</span>gem <span style="color: #c20cb9; font-weight: bold;">install</span> rake</pre></div></div>

<p>Add this to /etc/apache2/apache2.conf</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;"><span style="color: #00007f;">LoadModule</span> passenger_module /opt/ruby-enterprise-1.8.6-<span style="color: #ff0000;">20081215</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-2.0.6/ext/apache2/mod_passenger.so
PassengerRoot /opt/ruby-enterprise-1.8.6-<span style="color: #ff0000;">20081215</span>/lib/ruby/gems/<span style="color: #ff0000;">1.8</span>/gems/passenger-2.0.6
PassengerRuby /opt/ruby-enterprise-1.8.6-<span style="color: #ff0000;">20081215</span>/bin/ruby</pre></div></div>

<p>That&#8217;s it ! Now you can configure your vhosts.</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> 192.168.0.1:<span style="color: #ff0000;">80</span>&gt;
  <span style="color: #00007f;">ServerName</span> foo.com
  <span style="color: #00007f;">DocumentRoot</span> /var/rails/
&nbsp;
  RailsBaseURI /project1
  RailsBaseURI /project2
  RailsBaseURI /project3
&nbsp;
  <span style="color: #00007f;">Alias</span> /docs <span style="color: #7f007f;">&quot;/opt/ruby-enterprise-1.8.6-20081215/lib/ruby/gems/1.8/gems/passenger-2.0.6/doc/Users guide.html&quot;</span>
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<p>An finaly, the capistrano config in deploy.rb</p>

<div class="wp_syntax"><div class="code"><pre class="ruby" style="font-family:monospace;">set <span style="color:#ff3333; font-weight:bold;">:application</span>, <span style="color:#996600;">&quot;project1&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:repository</span>,  <span style="color:#996600;">&quot;https://svn.foo.com/project1&quot;</span>
set <span style="color:#ff3333; font-weight:bold;">:user</span>, <span style="color:#996600;">'root'</span>
set <span style="color:#ff3333; font-weight:bold;">:use_sudo</span>, <span style="color:#0000FF; font-weight:bold;">false</span>
<span style="color:#008000; font-style:italic;"># If you aren't deploying to /u/apps/#{application} on the target</span>
<span style="color:#008000; font-style:italic;"># servers (which is the default), you can specify the actual location</span>
<span style="color:#008000; font-style:italic;"># via the :deploy_to variable:</span>
set <span style="color:#ff3333; font-weight:bold;">:deploy_to</span>, <span style="color:#996600;">&quot;/var/rails/#{application}&quot;</span>
&nbsp;
after <span style="color:#996600;">&quot;deploy:update_code&quot;</span>, <span style="color:#996600;">&quot;deploy:chown&quot;</span>
&nbsp;
role <span style="color:#ff3333; font-weight:bold;">:app</span>, <span style="color:#996600;">&quot;foo.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:web</span>, <span style="color:#996600;">&quot;foo.com&quot;</span>
role <span style="color:#ff3333; font-weight:bold;">:db</span>,  <span style="color:#996600;">&quot;foo.com&quot;</span>, <span style="color:#ff3333; font-weight:bold;">:primary</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#0000FF; font-weight:bold;">true</span>
&nbsp;
namespace <span style="color:#ff3333; font-weight:bold;">:deploy</span> <span style="color:#9966CC; font-weight:bold;">do</span>
  desc <span style="color:#996600;">&quot;Change owner&quot;</span>
  task <span style="color:#ff3333; font-weight:bold;">:chown</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:app</span> <span style="color:#9966CC; font-weight:bold;">do</span>
    run <span style="color:#996600;">&quot;chown www-data:www-data -R #{latest_release}&quot;</span>
  <span style="color:#9966CC; font-weight:bold;">end</span>
  desc <span style="color:#996600;">&quot;Restart Application&quot;</span>
  task <span style="color:#ff3333; font-weight:bold;">:restart</span>, <span style="color:#ff3333; font-weight:bold;">:roles</span> <span style="color:#006600; font-weight:bold;">=&gt;</span> <span style="color:#ff3333; font-weight:bold;">:app</span> <span style="color:#9966CC; font-weight:bold;">do</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>in case you have this error:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">script<span style="color: #000000; font-weight: bold;">/</span>console production
Loading production environment <span style="color: #7a0874; font-weight: bold;">&#40;</span>Rails 2.1.0<span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb<span style="color: #000000; font-weight: bold;">/</span>completion.rb:<span style="color: #000000;">10</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>require<span style="color: #ff0000;">': no such file to load -- readline (LoadError)
        from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/completion.rb:10
        from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:252:in `require'</span>
        from <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb<span style="color: #000000; font-weight: bold;">/</span>init.rb:<span style="color: #000000;">252</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>load_modules<span style="color: #ff0000;">'
        from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:250:in `each'</span>
        from <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb<span style="color: #000000; font-weight: bold;">/</span>init.rb:<span style="color: #000000;">250</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>load_modules<span style="color: #ff0000;">'
        from /opt/ruby-enterprise-1.8.6-20081215/lib/ruby/1.8/irb/init.rb:21:in `setup'</span>
        from <span style="color: #000000; font-weight: bold;">/</span>opt<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>lib<span style="color: #000000; font-weight: bold;">/</span>ruby<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">1.8</span><span style="color: #000000; font-weight: bold;">/</span>irb.rb:<span style="color: #000000;">54</span>:<span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">`</span>start<span style="color: #ff0000;">'
        from /usr/bin/irb:13</span></pre></div></div>

<p>Then some things where missing during install. Let&#8217;s install that and compile readling.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #7a0874; font-weight: bold;">cd</span> <span style="color: #000000; font-weight: bold;">/</span>root<span style="color: #000000; font-weight: bold;">/</span>ruby-enterprise-1.8.6-<span style="color: #000000;">20081215</span><span style="color: #000000; font-weight: bold;">/</span>source<span style="color: #000000; font-weight: bold;">/</span>ext<span style="color: #000000; font-weight: bold;">/</span>readline
&nbsp;
ruby extconf.rb
checking <span style="color: #000000; font-weight: bold;">for</span> tgetnum<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lncurses... no
checking <span style="color: #000000; font-weight: bold;">for</span> tgetnum<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -ltermcap... no
checking <span style="color: #000000; font-weight: bold;">for</span> tgetnum<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span> <span style="color: #000000; font-weight: bold;">in</span> -lcurses... no
checking <span style="color: #000000; font-weight: bold;">for</span> readline<span style="color: #000000; font-weight: bold;">/</span>readline.h... no
&nbsp;
<span style="color: #c20cb9; font-weight: bold;">apt-get</span> <span style="color: #c20cb9; font-weight: bold;">install</span> libncurses5-dev libreadline5-dev</pre></div></div>

<p>Check once again if everything is installed</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">ruby extconf.rb
.
.
creating Makefile</pre></div></div>

<p>and now compile</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">make</span>
<span style="color: #c20cb9; font-weight: bold;">make</span> <span style="color: #c20cb9; font-weight: bold;">install</span></pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://cristian.livadaru.net/2009/01/12/howto-installing-ruby-enterprise-edition-and-passenger-on-debian-etch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

