Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>After weeks of trial and error I have finally been able to fix this by RTFM. I am surprised that there were no responses to my question on Stackoverflow and I was not able to find any other articles elsewhere that helped with my question. This issue has to be affecting everyone who is deploying a RoR app using Capistrano on a Linux server running Apache2 and Passenger.</p> <p>I have Capistrano deploying the app to /home/smith/www/dashboard which creates a current folder which symlinks to releases/</p> <p>Passenger needs to find config/environment.rb to launch the Rails app. By default, Phusion Passenger assumes that the application’s root directory is the parent directory of the public directory.See: <a href="http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerAppRoot">http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerAppRoot</a> </p> <p>The problem is that when using Capistrano, by default it deploys the app to </p> <p>/home/smith/www/dashboard/current/</p> <p>So by default Passenger reckons the path to be:</p> <p>/home/smith/www/dashboard/config/environment.rb</p> <p>Passenger provides the ability to set the PassengerAppRoot configuration option in Apache virtual host file like so:</p> <p>PassengerAppRoot /home/smith/www/dashboard/current</p> <p>This allows Passenger to find the config/environment.rb file correctly:</p> <p>PassengerAppRoot /home/scervera/www/dashboard/current/config/environment.rb</p> <p>Here is the rest of my virtual host file:</p> <pre><code>&lt;VirtualHost *:80&gt; ServerName www.example.com DocumentRoot /home/smith/www/dashboard/current/public &lt;Directory /home/smith/www/dashboard/current/public&gt; Options FollowSymLinks AllowOverride none Order allow,deny Allow from all &lt;/Directory&gt; PassengerAppRoot /home/smith/www/dashboard/current &lt;/VirtualHost&gt; </code></pre> <p>There may be other ways to fix this, but I believe this is "by the book".</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload