Nginx – Starting Rails App with Phusion Passenger Standalone

nginxphusion-passengerrubyruby-on-railsweb-server

I am deploying a Rails application ( Project Fedena ) to a VPS at Digital Ocean.
I can use either of mongrel_rails start and ruby script/server to launch my app with no problem. It binds to port :3000 and I can use the application as desired.

The problem is with Phusion Passenger, I have installed the gem gem install passenger however, when I run passenger start from my rails app root, there's a permissions issue, which doesn't seem to be the case with Mongrel or Webrick:

=============== Phusion Passenger Standalone web server started ===============
PID file: /root/fedena/tmp/pids/passenger.80.pid
Log file: /root/fedena/log/passenger.80.log
Environment: production
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/documentation/Users%20guide%20Standalone.html#troubleshooting
===============================================================================
2015/03/08 01:35:03 [error] 18827#0: *4 directory index of "/root/fedena/public/" is forbidden, client: 127.0.0.1, server: _, request: "HEAD / HTTP/1.1", host: "0.0.0.0"

There is only one user (0) on this machine that owns all the directories. I've performed a recursive chmod on the directory to 777, 775, 755.

Best Answer

My problem turned out to be the passenger gem passenger (5.0.2) released just yesterday (March 7, 2015). This explains why I couldn't find anyone with my specific problem.

I solved this and successfully launched my rails application by uninstalling version 5.0.2 and installing version 4.0.59 (the last stable version from the 4.* branch):

  1. gem uninstall passenger -Iax
  2. gem install --no-ri --no-rdoc --verbose passenger -v 4.0.59

Bug report filed. I hope this helps :)

Related Topic