<?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>Sean&#039;s Blog &#187; passenger</title>
	<atom:link href="http://seanbehan.com/tag/passenger/feed/" rel="self" type="application/rss+xml" />
	<link>http://seanbehan.com</link>
	<description>Web Programming, Ruby on Rails, Wordpress, PHP from Burlington, Vermont</description>
	<lastBuildDate>Wed, 18 Jan 2012 21:44:54 +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>Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems &gt;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org</title>
		<link>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/</link>
		<comments>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/#comments</comments>
		<pubDate>Fri, 01 Oct 2010 14:00:21 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[console]]></category>
		<category><![CDATA[irb]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[production]]></category>
		<category><![CDATA[Rails]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[rubygems]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=1211</guid>
		<description><![CDATA[After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time ./script/console production # =&#62; Loading production environment (Rails 2.3.5) Rails requires RubyGems &#62;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org You then scratch your head and run which gem which [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Flinux%2Fruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Ruby Enterprise Edition and Passenger ./script/console production fails and instead returns Loading production environment (Rails 2.3.5) Rails requires RubyGems >= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org" data-url="http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>After installing Ruby Enterprise Edition, REE, and Passenger on Ubuntu you may see this error message when you run script/console for the first time</p>
<pre class="wp-code-highlight prettyprint">
./script/console production
# =&gt;
Loading production environment (Rails 2.3.5)
Rails requires RubyGems &gt;= 1.3.2. Please install RubyGems and try again: http://rubygems.rubyforge.org
</pre>
<p>You then scratch your head and run </p>
<pre class="wp-code-highlight prettyprint">
which gem
which ruby
which rails
</pre>
<p>to find that all appears to be in order. You have rubygems installed , ruby is installed and so is rails. You also find that each are pointing to the correct location, which is something like /usr/bin/gem -> /opt/ruby-enterprise-x.x.x.x/bin/gem, where x.x.x.x is the version of REE. </p>
<p>The problem isn&#8217;t however, with any of the above. The issue is with the location of irb. If you installed (like me) irb with apt-get install irb, then irb isn&#8217;t aware of your shiny new REE and ruby gems. It&#8217;s a simple fix however, unlink irb and symlink the /usr/bin/irb to REE&#8217;s irb like so&#8230;  </p>
<pre class="wp-code-highlight prettyprint">
rm /usr/bin/irb
</pre>
<p>And symlink it to the irb that REE has in bin </p>
<pre class="wp-code-highlight prettyprint">
ln -s /opt/ruby-enterprise-x.x.x.x/bin/irb /usr/bin/irb
</pre>
<p>Now cd into your rails app and run </p>
<pre class="wp-code-highlight prettyprint">
./script/console production
</pre>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/linux/ruby-enterprise-edition-and-passenger-scriptconsole-production-fails-and-instead-returns-loading-production-environment-rails-2-3-5-rails-requires-rubygems-1-3-2-please-install-rubygems-and-t/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Installing RedMine PM Software on Apache with Phusion and REE and Seeing a 404 Page Not Found Error on Installation</title>
		<link>http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/</link>
		<comments>http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/#comments</comments>
		<pubDate>Sat, 27 Mar 2010 00:53:02 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[404]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[htaccess]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[phusion]]></category>
		<category><![CDATA[redmine]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[troubleshooting]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=892</guid>
		<description><![CDATA[If you follow the instructions on how to install the Rails Redmine PM Software (available here) and are using Apache with Passenger (REE), you need to delete the .htaccess file that is kept in RAILS_ROOT/public directory. Otherwise you&#8217;ll see a 404 page not found error. Took me a while to hunt this down. I stopped [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby-on-rails%2Finstalling-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Installing RedMine PM Software on Apache with Phusion and REE and Seeing a 404 Page Not Found Error on Installation" data-url="http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>If you follow the instructions on how to install the Rails Redmine PM Software <a href="http://www.redmine.org/wiki/1/RedmineInstall">(available here)</a> and are using Apache with Passenger (REE), you need to delete the .htaccess file that is kept in RAILS_ROOT/public directory. Otherwise you&#8217;ll see a 404 page not found error. Took me a while to hunt this down. I stopped thinking about .htaccess in Rails apps but I guess REE+Passenger isn&#8217;t the default deployment yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/installing-redmine-pm-software-on-apache-with-phusion-and-ree-and-seeing-a-404-page-not-found-error-on-installation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition</title>
		<link>http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/</link>
		<comments>http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/#comments</comments>
		<pubDate>Thu, 25 Feb 2010 21:40:02 +0000</pubDate>
		<dc:creator>bseanvt</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[alias]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[feedzirra]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[mod rails]]></category>
		<category><![CDATA[passenger]]></category>
		<category><![CDATA[passenger app root]]></category>
		<category><![CDATA[path prefix]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[phussion]]></category>
		<category><![CDATA[ree]]></category>
		<category><![CDATA[relative url rails]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[ruby enterprise edition]]></category>
		<category><![CDATA[subdirectory]]></category>
		<category><![CDATA[VirtualHost]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://seanbehan.com/?p=795</guid>
		<description><![CDATA[Here is how to install a Rails application out of a subdirectory (rather than as a subdomain) with the Apache web server(Apache2). In this example I&#8217;m going to use my own blog which is a WordPress installation and serve a Rails application from the subdirectory &#8220;reader&#8221;. Note, I&#8217;m not going to keep my Rails application [...]]]></description>
			<content:encoded><![CDATA[<div style="height:33px;" class="really_simple_share robots-nocontent snap_nopreview"><div class="really_simple_share_facebook_like" style="width:px;">
				<iframe src="http://www.facebook.com/plugins/like.php?href=http%3A%2F%2Fseanbehan.com%2Fruby-on-rails%2Finstall-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition%2F&amp;layout=button_count&amp;show_faces=false&amp;width=&amp;action=like&amp;colorscheme=light&amp;send=false&amp;height=27" 
						scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:px; height:27px;" allowTransparency="true"></iframe>
				</div><div class="really_simple_share_twitter" style="width:px;">
					<a href="http://twitter.com/share" class="twitter-share-button" data-count="horizontal" 
						data-text="Install and Serve a Rails Application from PHP Subdirectory Using Apache, Phussion Passenger and Ruby Enterprise Edition" data-url="http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/" 
						data-via="" ></a> 
				</div></div>
		<div style="clear:both;"></div><p>Here is how to install a Rails application out of a subdirectory (rather than as a subdomain) with the Apache web server(Apache2). In this example I&#8217;m going to use my own blog which is a WordPress installation and serve a Rails application from the subdirectory &#8220;reader&#8221;. Note, I&#8217;m not going to keep my Rails application in the document root of my WordPress Blog, which is a PHP application and therefore anyone could browse the ruby source code :(. I&#8217;ll keep it elsewhere on the filesystem and tell Apache about the location in the VirtualHost file.</p>
<p>You can visit the application by going to  <a href="http://seanbehan.com/reader">http://seanbehan.com/reader</a>. The application just parses a bunch of RSS feeds and displays them.<br />
It uses the Feedzirra library, which I&#8217;ve also written about <a href="http://seanbehan.com/ruby-on-rails/installing-feedzirra-rss-parser-on-ubuntu-8/">http://seanbehan.com/ruby-on-rails/installing-feedzirra-rss-parser-on-ubuntu-8/</a>.</p>
<p>I&#8217;m using Phussion Passenger and Ruby Enterprise Edition from the folks at <a href="http://www.modrails.com/">Mod Rails</a>. Installing both Phussion Passenger and Ruby Enterprise Edition is simple and a very well documented process. However, you&#8217;ll need to download and compile them from source. If you install Ruby Enterprise Edition (REE) it comes w/ Passenger so you won&#8217;t need to download it separately. I recommend going with REE. <a href="http://www.rubyenterpriseedition.com/download.html">http://www.rubyenterpriseedition.com/download.html</a></p>
<h3>Installing Ruby Enterprise Edition</h3>
<p>Here are the commands to download and install (change the X.X.X to the package you&#8217;ve actually downloaded).</p>
<pre class="wp-code-highlight prettyprint">
wget http://rubyforge.org/frs/download.php/68719/ruby-enterprise-1.8.7-2010.01.tar.gz
tar xzvf ruby-enterprise-X.X.X.tar.gz
./ruby-enterprise-X.X.X/installer
</pre>
<p>When you run the installer you&#8217;ll be prompted for an installation location. Just hit enter to install in the default location. Follow the instructions from there and remember to copy/paste any code that they give you.</p>
<p>Official Instructions on installation for Passenger on its own are available here <a href="http://www.modrails.com/install.html">http://www.modrails.com/install.html</a> I&#8217;ve written about setting up an entire box w/ Passenger here <a href="http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/">http://seanbehan.com/ruby-on-rails/new-ubuntu-slice-apache-mysql-php-ruby-on-rails-git-and/</a> If you already have Passenger installed and want to use REE just download and install REE and it&#8217;ll recompile Passenger with REE support if you follow the instructions.</p>
<p>*** If you install REE you&#8217;ll need to either link or reinstall all your gems. I linked the REE gem with the one in /usr/bin so that I can run  gem install <gem name> and REE will be aware of it.</p>
<pre class="wp-code-highlight prettyprint">
ln -s /opt/ruby-enterprise-X.X.X/bin/gem /usr/bin/gem
</pre>
<h3>The VirtualHost</h3>
<p>If you have Passenger and REE successfully installed you&#8217;ll need to modify your VirtualHost file and add Rails application information to it.</p>
<pre class="wp-code-highlight prettyprint">
&amp;lt;VirtualHost *&amp;gt;
  # Normal virtual host info
  ServerName seanbehan.com
  ServerAlias *.seanbehan.com
  DocumentRoot /var/www/seanbehan.com/wordpress

  # Rails info goes here
  Alias /reader /var/www/seanbehan.com/reader/public
  &amp;lt;Location /reader&amp;gt;
    PassengerAppRoot /var/www/seanbehan.com/reader
    RailsEnv production
  &amp;lt;/Location&amp;gt;
&amp;lt;/VirtualHost&amp;gt;
</pre>
<p>The &#8220;Location&#8221; directive tells apache to forward requests starting with /reader to the directory<br />
/var/www/seanbehan.com/reader/public which is the location of our Rails app. However, we need to add the PassengerAppRoot assignment so that it knows where the actual application lives.</p>
<h3>Routing in Rails with Relative Path</h3>
<p>And finally, your Rails application will need to be aware of the relative url prefix assigned to each route. Normally, you could do this w/ the :path_prefix at the individual route level like so</p>
<pre class="wp-code-highlight prettyprint">
map.resources :feeds, :path_prefix =&gt; &quot;reader&quot;
</pre>
<p>This will work but you can add a line to your RAILS_ROOT/config/environments/production.rb file which will handle all your routes for you. This way you don&#8217;t need to setup a relative path on your development environment work.</p>
<pre class="wp-code-highlight prettyprint">
# in RAILS_ROOT/config/environments/production.rb
config.action_controller.relative_url_root = '/reader'
</pre>
<h3>Final Thoughts</h3>
<p>Remember Ruby Enterprise Edition is the new Ruby Interpreter that your Rails web applications are using. If you<br />
have any gem or rake issues make sure that you&#8217;re using the same interpreter that REE is using. Look in the location<br />
installation of REE &#8220;/opt/ruby-ent&#8230;&#8221; bin/gem or bin/rake and see if that helps. I just linked those to the standard /usr/bin/gem and /usr/bin/rake and everything worked fine.</p>
<p>Also I&#8217;ve read some people have trouble using the alias with passenger. This may be an older issue but works for me without a problem on Ubuntu (latest).</p>
<p>Here are some useful resources I found along the way&#8230;</p>
<p>http://robots.thoughtbot.com/post/159806388/phusion-passenger-with-a-prefix</p>
<p>http://www.modrails.com/documentation/Users%20guide.html#deploying_rails_to_sub_uri</p>
<p>http://www.modrails.com/documentation/Users%20guide.html#RailsBaseURI</p>
<p>http://stackoverflow.com/questions/848258/server-prefix-and-rails-routes</p>
]]></content:encoded>
			<wfw:commentRss>http://seanbehan.com/ruby-on-rails/install-and-serve-a-rails-application-from-php-subdirectory-using-apache-phussion-passenger-and-ruby-enterprise-edition/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

