I have been banging my head against a door trying to deploy a Rails 4 app on Ubuntu 14 + Apache2 + Passenger. I seemed to have made some progress: passenger is installed properly with the proper apache modules, my apache conf files are set up, everything is restarted, etc.. when I go to my site I get a listing of my Rails App's public directory. I investigated the logs and found the following:
Passenger could not be initialized because of this error: Option 'agents_dir' missing in file '/usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini'
I different SO post said something about mods-available stuff so here's /etc/apache2/mods-available/passenger.conf
:
<IfModule mod_passenger.c>
PassengerRoot /usr/lib/ruby/vendor_ruby/phusion_passenger/locations.ini
PassengerDefaultRuby /usr/bin/ruby
</IfModule>
And /etc/apache2/mods-available/passenger.load
:
LoadModule passenger_module /usr/lib/apache2/modules/mod_passenger.so
What am I doing wrong? I'm going to kiss whoever solves this, I swear.
I just ran into this problem and fixed it by reinstalling the passenger
package using the following command:
sudo apt-get install --reinstall passenger passenger-dev
If you happen to have same issue while Upgrading Nginx and Passenger on Ubuntu 14.04
sudo apt-get purge passenger
sudo apt-get remove nginx (it won't remove your config files)
and then
sudo apt-get install nginx-full passenger
locations.ini
is a passenger + ngnix config related item, and does not apply for passenger + apache config.
See the Phusion Passenger users guide, Apache version for details about how to configure passenger with apache.
Or see Phusion Passenger users guide, Nginx version for configuring passenger with nginx.
If you are going the passenger + apache route, the key step you seem to be missing is to run passenger-install-apache2-module
which provides the right values for PassengerRoot
, PassengerDefaultRuby
, etc.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With