I got error like Phusion Passenger is currently not serving any applications.
while trying to restart passenger with passenger-config restart-app
command.
我得到的错误就像Phusion Passenger目前没有提供任何应用程序。尝试使用passenger-config restart-app命令重新启动乘客。
I googled but most of the answers were only related with deployment.
我用谷歌搜索,但大多数答案只与部署有关。
I want to restart passenger in the development environment as I am using vhost. PS. My web server is nginx.
我想在开发环境中重新启动乘客,因为我正在使用vhost。 PS。我的网络服务器是nginx。
2 个解决方案
#1
5
See my comment here.
在这里看我的评论。
You need to explicitly specify, where actual Ruby code of a Rails application is located, using passenger_app_root
directive, described in Passenger's documentaion.
您需要使用乘客的文档中描述的passenger_app_root指令显式指定Rails应用程序的实际Ruby代码所在的位置。
Without this directive, Passenger will thinck, that actual Ruby code is located in path, specified with root nginx-directive.
如果没有这个指令,Passenger将会瘦,实际的Ruby代码位于路径中,使用root nginx-directive指定。
Example of a correct configuration file '/etc/nginx/sites-available/app_name':
正确配置文件'/ 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;
}
}
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
.
就我而言,Passenger没有为我的Rails应用程序提供服务,该应用程序是与Capistrano一起部署的。我必须为后面的/ var / www / my_app / current指定passenger_app_root的值。
This will point Passenger exactly, where application code is presented.
这将准确指出Passenger,其中显示了应用程序代码。
#2
2
I am betting your passenger is running.
If you look at step 3, it hints at what I am talking about.
我打赌你的乘客正在跑步。如果你看第3步,就会暗示我在说什么。
https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/
https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/
Nginx will take care of passenger for you if it's set up to do that. Can you try the command in that tutorial and look for passenger processes too ?
如果设置的话,Nginx将为您照顾乘客。您可以尝试该教程中的命令并查找乘客流程吗?
sudo /usr/sbin/passenger-memory-stats
Good luck!
祝你好运!
#1
5
See my comment here.
在这里看我的评论。
You need to explicitly specify, where actual Ruby code of a Rails application is located, using passenger_app_root
directive, described in Passenger's documentaion.
您需要使用乘客的文档中描述的passenger_app_root指令显式指定Rails应用程序的实际Ruby代码所在的位置。
Without this directive, Passenger will thinck, that actual Ruby code is located in path, specified with root nginx-directive.
如果没有这个指令,Passenger将会瘦,实际的Ruby代码位于路径中,使用root nginx-directive指定。
Example of a correct configuration file '/etc/nginx/sites-available/app_name':
正确配置文件'/ 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;
}
}
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
.
就我而言,Passenger没有为我的Rails应用程序提供服务,该应用程序是与Capistrano一起部署的。我必须为后面的/ var / www / my_app / current指定passenger_app_root的值。
This will point Passenger exactly, where application code is presented.
这将准确指出Passenger,其中显示了应用程序代码。
#2
2
I am betting your passenger is running.
If you look at step 3, it hints at what I am talking about.
我打赌你的乘客正在跑步。如果你看第3步,就会暗示我在说什么。
https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/
https://www.phusionpassenger.com/library/install/nginx/install/oss/trusty/
Nginx will take care of passenger for you if it's set up to do that. Can you try the command in that tutorial and look for passenger processes too ?
如果设置的话,Nginx将为您照顾乘客。您可以尝试该教程中的命令并查找乘客流程吗?
sudo /usr/sbin/passenger-memory-stats
Good luck!
祝你好运!