用Phusion Passenger独立启动Rails应用程序?

我正在Digital Ocean部署一个Rails应用程序( Fedena项目 )给VPS。 我可以使用mongrel_rails startruby script/server启动我的应用程序没有问题。 它绑定到端口:3000,我可以根据需要使用该应用程序。

问题是用Phusion Passenger,但是我已经安装了gemgem install passenger但是当我运行passenger start从我的Rails应用程序根目录开始时,有一个权限问题,似乎并不是Mongrel或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" 

这台机器上只有一个用户(0)拥有所有的目录。 我已经在777,775,755目录上执行recursionchmod。

我的问题原来是昨天(2015年3月7日)发布的乘客gempassenger (5.0.2) )。 这解释了为什么我找不到有我的具体问题的人。

我解决了这个问题,并通过卸载5.0.2版本和安装版本4.0.59 (从4. *分支的最后一个稳定版本)成功地启动了我的rails应用程序:

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

错误报告提交。 我希望这有帮助 :)

你必须做一个config.ru文件以下内容使用config.ru 2.3应用程序

 # Require your environment file to bootstrap Rails require ::File.dirname(__FILE__) + '/config/environment' # Serve static assets from RAILS_ROOT/public directory # use Rails::Rack::Static # Dispatch the request run ActionController::Dispatcher.new 

来源: https : //blog.phusion.nl/2015/03/04/phusion-passenger-5-0-1-released/