After several weeks of trial and error, I was finally able to fix this with RTFM. I am surprised that there were no answers to my question about Stackoverflow, and I could not find other articles elsewhere that helped me in my question. This issue should affect everyone who deploys a RoR application using Capistrano on a Linux server running Apache2 and Passenger.
I have Capistrano deploying an application to / home / smith / www / dashboard that creates the current folder, symbolically linking to releases /
The passenger must find config / environment.rb to launch the Rails application. By default, Phusion Passenger assumes that the application root directory is the parent directory of the public directory. See: http://www.modrails.com/documentation/Users%20guide%20Apache.html#PassengerAppRoot
The problem is that when using Capistrano by default, it deploys the application to
/ main / blacksmith / WWW / dashboard / current /
Thus, by default, Passenger defines the path:
/home/smith/www/dashboard/config/environment.rb
Passenger provides the ability to set the PassengerAppRoot configuration parameter in the Apache virtual host file as follows:
PassengerAppRoot / home / smith / www / dashboard / current
This allows the Passenger to correctly find the config / environment.rb file:
PassengerAppRoot / home / scervera / www / dashboard / current / config / environment.rb
Here is the rest of my virtual host file:
<VirtualHost *:80> ServerName www.example.com DocumentRoot /home/smith/www/dashboard/current/public <Directory /home/smith/www/dashboard/current/public> Options FollowSymLinks AllowOverride none Order allow,deny Allow from all </Directory> PassengerAppRoot /home/smith/www/dashboard/current </VirtualHost>
There may be other ways to fix this, but I think this is “by the book.”