<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="/stylesheets/rss.css" type="text/css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>OnRails.org: Running mod_rails on Leopard (OSX 10.5)</title>
    <link>http://onrails.org/articles/2008/06/14/running-mod_rails-on-leopard-osx-10-5</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ruby On Rails and related matters.</description>
    <item>
      <title>Running mod_rails on Leopard (OSX 10.5)</title>
      <description>&lt;p&gt;From the command line:&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;gem install passenger
sudo passenger-install-apache2-module&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;The Apache 2 module was successfully installed.&lt;/p&gt;


	&lt;p&gt;Please edit your Apache configuration file, and add these lines:&lt;/p&gt;


	&lt;pre&gt;&lt;code&gt;LoadModule passenger_module /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/ext/apache2/mod_passenger.so
RailsSpawnServer /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/bin/passenger-spawn-server
RailsRuby /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby&lt;/code&gt;&lt;/pre&gt;


	&lt;p&gt;Hey&amp;#8230;where is the configuration. Google told me to read this blog entry: http://www.fuzzylizard.com/archives/2008/05/29/947/&lt;/p&gt;


	&lt;p&gt;So copy these three lines and add them to the end of this file:  /etc/apache2/httpd.conf&lt;/p&gt;


	&lt;p&gt;$ sudo mate /etc/apache2/httpd.conf&lt;/p&gt;


	&lt;p&gt;Start and stop Apache go the to the System Preferences|Sharing and select the Web Sharing  service:&lt;/p&gt;


&lt;div style="text-align:center;"&gt;&lt;img src="http://onrails.org/files/20080616_syspref.jpg" alt="20080616_syspref.jpg" border="0" width="467" height="382" /&gt;&lt;/div&gt;

	&lt;p&gt;Then the install script gives you the following instructions.&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;Deploying a Ruby on Rails application: an example

Suppose you have a Ruby on Rails application in /somewhere. Add a virtual host
to your Apache configuration file, and set its DocumentRoot to
/somewhere/public, like this:

   &amp;lt;VirtualHost *:80&amp;gt;
      ServerName www.yourhost.com
      DocumentRoot /somewhere/public
   &amp;lt;/VirtualHost&amp;gt;

And that's it! You may also want to check the Users Guide for security and
optimization tips and other useful information:

  /Library/Ruby/Gems/1.8/gems/passenger-1.0.5/doc/Users guide.html

Enjoy Passenger, a product of Phusion (www.phusion.nl) :-)
http://www.modrails.com/ &lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Now where is &amp;#8220;my&amp;#8221; apache configuration file? And more important where is yours? On the command line do&lt;/p&gt;


	&lt;p&gt;$ ls /etc/apache2/users/&lt;/p&gt;


	&lt;p&gt;And I see daniel.conf, so let&amp;#8217;s edit that one. I am developing one Rails app in this folder: /Users/daniel/SvnProjects/for/stockportfolio/rails. So let&amp;#8217;s define this application in that conf file:&lt;/p&gt;


	&lt;p&gt;$ sudo mate  /etc/apache2/users/daniel.conf&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;&amp;lt;Directory &amp;quot;/Users/daniel/SvnProjects/for/stockportfolio/rails/&amp;quot;&amp;gt;
    Order allow,deny
    Allow from all
&amp;lt;/Directory&amp;gt;

&amp;lt;VirtualHost *:80&amp;gt;
   ServerName dev.stockportfolio.com
   DocumentRoot /Users/daniel/SvnProjects/for/stockportfolio/rails/public
&amp;lt;/VirtualHost&amp;gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Note the /public at the end of the folder in the DocumentRoot. 
Now I am adding dev.stockportfolio.com in my /etc/hosts file. So just add the following line&lt;/p&gt;


&lt;div class="typocode"&gt;&lt;pre&gt;&lt;code class="typocode_default "&gt;127.0.0.1  dev.stockportfolio.com&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

	&lt;p&gt;Now go back to the system preference sharing tab and restart the web service. Now you have your application running &amp;#8230; in production mode. Just point your browser to dev.stockportfolio.com.&lt;/p&gt;


	&lt;p&gt;Enjoy Daniel!&lt;/p&gt;</description>
      <pubDate>Sat, 14 Jun 2008 22:40:29 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ca39ae56-7543-4d90-b9da-32ca607b4072</guid>
      <author>Daniel Wanja</author>
      <link>http://onrails.org/articles/2008/06/14/running-mod_rails-on-leopard-osx-10-5</link>
    </item>
    <item>
      <title>"Running mod_rails on Leopard (OSX 10.5)" by Dr Nic</title>
      <description>&lt;p&gt;When i run the installer command on Leopard I get the following error:&lt;/p&gt;


&lt;pre&gt;## In ext/boost/src:
g++ -g -DPASSENGER_DEBUG -fPIC -I../.. -D_REENTRANT -DNDEBUG -arch ppc7400 -arch ppc64 -arch i386 -arch x86_64 -c *.cpp pthread/*.cpp
g++-4.0: installation problem, cannot exec '': No such file or directory

lipo: can't figure out the architecture type of: /var/tmp//cc8yEvUx.out
rake aborted!
Command failed with status (255): [g++ -g -DPASSENGER_DEBUG -fPIC -I../.. -D_...]
/Library/Ruby/Gems/1.8/gems/passenger-1.9.0/rakefile:97
(See full trace by running task with --trace)&lt;/pre&gt;

	&lt;p&gt;Anyone seen + fixed this?&lt;/p&gt;</description>
      <pubDate>Sun, 15 Jun 2008 23:15:21 +0000</pubDate>
      <guid isPermaLink="false">urn:uuid:ec3e3dfd-3c41-4729-abe8-4791026b6160</guid>
      <link>http://onrails.org/articles/2008/06/14/running-mod_rails-on-leopard-osx-10-5#comment-3717</link>
    </item>
  </channel>
</rss>
