Phusion Passenger当前不提供任何应用程序 [英] Phusion Passenger is currently not serving any applications

查看:68
本文介绍了Phusion Passenger当前不提供任何应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试使用passenger-config restart-app命令重新启动乘客时,出现类似Phusion Passenger is currently not serving any applications. 的错误.

I got error like Phusion Passenger is currently not serving any applications. while trying to restart passenger with passenger-config restart-app command.

我用谷歌搜索,但大多数答案仅与部署有关.

I googled but most of the answers were only related with deployment.

我想在开发环境中重新启动乘客,因为我正在使用vhost. PS.我的Web服务器是nginx.

I want to restart passenger in the development environment as I am using vhost. PS. My web server is nginx.

推荐答案

请参阅我的评论您需要使用如果没有此指令,Passenger将会稀疏,实际的Ruby代码位于以root nginx指令指定的路径中.

Without this directive, Passenger will thinck, that actual Ruby code is located in path, specified with root nginx-directive.

正确的配置文件'/etc/nginx/sites-available/app_name'的示例:

Example of a correct configuration file '/etc/nginx/sites-available/app_name':

server {
  listen 80;

  server_name 188.225.35.216;
  passenger_enabled on;
  rails_env    production;
  root         /path/to/your/app/public/folder;
  passenger_app_root /path/to/your/app/code; # <<< Point Passenger to application code

  # redirect server error pages to the static page /50x.html
  error_page   500 502 503 504  /50x.html;
  location = /50x.html {
    root   html;
  }
}

在我的情况下,Passenger并未为Capistrano部署的Rails应用提供服务. 我必须为passenger_app_root指定一个值,就像跟随/var/www/my_app/current一样.

In my case, Passenger was't serving my Rails app, that was deployed with Capistrano. I had have to specify a value for passenger_app_root like following /var/www/my_app/current.

这将准确指向乘客,其中显示了应用程序代码.

This will point Passenger exactly, where application code is presented.

这篇关于Phusion Passenger当前不提供任何应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆