简体   繁体   中英

Passenger 5 / Capistrano

I'm trying to deploy Rails application to VPS via Capistrano. I have passenger standalone installed on the VPS and using capistrano-passenger gem with default configuration.

Running cap deploy produces the following output:

DEBUG [3197887c] Finished in 0.046 seconds with exit status 0 (successful).
DEBUG [fdb1fe0b] Running /usr/bin/env passenger -v as deployer@52.64.82.147
DEBUG [fdb1fe0b] Command: cd /var/www/my_app/releases/20150625021829 && /usr/bin/env passenger -v
DEBUG [fdb1fe0b]    Phusion Passenger version 5.0.11
DEBUG [fdb1fe0b]    
DEBUG [fdb1fe0b]    
DEBUG [fdb1fe0b]    "Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.
DEBUG [fdb1fe0b]    
DEBUG [fdb1fe0b] Finished in 0.066 seconds with exit status 0 (successful).
INFO [8557b41e] Running /usr/bin/env sudo /usr/bin/env passenger-config restart-app /var/www/my_app --ignore-app-not-running as deployer@52.64.82.147
DEBUG [8557b41e] Command: cd /var/www/my_app/releases/20150625021829 && /usr/bin/env sudo /usr/bin/env passenger-config restart-app /var/www/my_app --ignore-app-not-running
DEBUG [8557b41e]    *** ERROR: Phusion Passenger doesn't seem to be running. If you are sure that it
DEBUG [8557b41e]    
DEBUG [8557b41e]    is running, then the causes of this problem could be one of:
DEBUG [8557b41e]    
DEBUG [8557b41e]    
DEBUG [8557b41e]     1. You customized the instance registry directory using Apache's
DEBUG [8557b41e]    
DEBUG [8557b41e]        PassengerInstanceRegistryDir option, Nginx's
DEBUG [8557b41e]    
DEBUG [8557b41e]        passenger_instance_registry_dir option, or Phusion Passenger Standalone's
DEBUG [8557b41e]    
DEBUG [8557b41e]        --instance-registry-dir command line argument. If so, please set the
DEBUG [8557b41e]    
DEBUG [8557b41e]        environment variable PASSENGER_INSTANCE_REGISTRY_DIR to that directory
DEBUG [8557b41e]    
DEBUG [8557b41e]        and run this command again.
DEBUG [8557b41e]    
DEBUG [8557b41e]     2. The instance directory has been removed by an operating system background
DEBUG [8557b41e]    
DEBUG [8557b41e]        service. Please set a different instance registry directory using Apache's
DEBUG [8557b41e]    
DEBUG [8557b41e]        PassengerInstanceRegistryDir option, Nginx's passenger_instance_registry_dir
DEBUG [8557b41e]        

I am using default config. Anything I can do to make it work?

Use set :passenger_restart_with_touch, true as a workaround on Passenger 5.

It's a known problem as described in https://github.com/capistrano/passenger/issues/26

我最近碰到了这个,我的情况是因为deploy用户需要对passenger-config命令使用sudoer权限。

Do you have gem 'passenger' in your Gemfile ?. Make sure that the passenger gem is installed on your VPS. Also, if you need Nginx as the webserver then run the following command on your VPS rvmsudo passenger-install-nginx-module . Let me know if you need further help.

First of all you should make sure passenger is currently running on your server, so try: rvmsudo bundle exec passenger start . If this worked, try to set:

set :passenger_in_gemfile, true
set :passenger_restart_with_sudo, true

and then check the setup with cap production passenger:restart .
(applicable to Passenger Standalone installed via Gemfile).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM