Coder Social home page Coder Social logo

passenger's Introduction

Capistrano::Passenger

Adds a task to restart your application after deployment via Capistrano. Supports Passenger versions 6 and lower.

Installation

Add this line to your application's Gemfile:

gem 'capistrano-passenger'

And then execute:

$ bundle

Or install it yourself as:

$ gem install capistrano-passenger

Usage

Add this line to your Capfile and deploy:restart will be setup to automatically run after :publishing is complete:

require 'capistrano/passenger'

You can also run the underlying task in isolation:

# Restart your Passenger application.
# The restart mechanism used is based on the version of Passenger installed on your server.
$ cap production passenger:restart
# Alternatively:
$ cap production deploy:restart

If you want the task to run at a different point in your deployment, require capistrano/passenger/no_hook instead of capistrano/passenger and then add your own hook in config/deploy.rb. When using this gem in this way, you must use passenger:restart--the deploy:restart alias is not available. Example:

# Capfile
require 'capistrano/passenger/no_hook'

# config/deploy.rb
after :some_other_task, :'passenger:restart'

Configurable options and their defaults:

set :passenger_roles, :app
set :passenger_restart_runner, :sequence
set :passenger_restart_wait, 5
set :passenger_restart_limit, 2
set :passenger_restart_with_sudo, false
set :passenger_environment_variables, {}
set :passenger_restart_command, 'passenger-config restart-app'
set :passenger_restart_options, -> { "#{deploy_to} --ignore-app-not-running" }

Restarting Your Passenger Application

In most cases, the default settings should just work for most people. This plugin checks the version of passenger you're running on your server(s) and invokes the appropriate restart mechanism based on that.

passenger_restart_wait and passenger_restart_limit are passed to the on block when restarting the application:

on roles(fetch(:passenger_roles)), in: fetch(:passenger_restart_runner), wait: fetch(:passenger_restart_wait), limit: fetch(:passenger_restart_limit) do
  with fetch(:passenger_environment_variables) do
    # Version-specific restart happens here.
  end
end

Note that passenger_restart_limit has no effect if you are using the default passenger_restart_runner of :sequence. sshkit only looks at it when the runner is :groups.

:passenger_environment_variables is available if anything about your environment is not available to the user deploying your application. One use-case for this is when passenger-config isn't available in your user's PATH on the server. You could override it like so:

set :passenger_environment_variables, { :path => '/your/path/to/passenger/bin:$PATH' }

Note for RVM users

https://www.phusionpassenger.com/documentation/Users%20guide%20Apache.html#_when_the_system_has_multiple_ruby_interpreters descibes how "Once installed, you can run Phusion Passenger’s Ruby parts under any Ruby interpreter you want, even if that Ruby interpreter was not the one you originally installed Phusion Passenger with. [...] There is however one caveat if you happen to be using RVM or RVM gemsets. When you gem install Phusion Passenger using RVM," it is available only to the Ruby version where it was installed. Therefore, if you are using RVM AND passenger was installed via RVM AND it was installed under a different version of RVM than fetch(:rvm_ruby_version), you need to set :passenger_rvm_ruby_version in your config/deploy.rb.

Note for rbenv users

If your passenger gem is installed on a different version of Ruby than your :rbenv_ruby Ruby, you can specify this with the following:

set :passenger_environment_variables, { rbenv_version: '3.0.1' }

Note for Standalone Passenger users

If you are running passenger in standalone mode, it is possible for you to put passenger in your Gemfile and rely on capistrano-bundler to install it with the rest of your bundle. If you are installing passenger during your deployment AND you are using the new restart method (see below), you need to set :passenger_in_gemfile to true in your config/deploy.rb.

Restarting Passenger >= 4.0.33 Applications

Passenger 4.0.33 introduced a new way to restart your application, and thus has some additional configuration options to accomodate for various server environments.

If you need to pass additional/different options to :passenger_restart_command, simply override :passenger_restart_options.

If you require sudo when restarting passenger, set :passenger_restart_with_sudo to true. Note: This option has no effect when restarting Passenger <= 4.0.32 applications.

To opt out of the new way to restart, and use the deprecated approach instead, set :passenger_restart_with_touch to true.

Contributing

  1. Fork it ( https://github.com/capistrano/passenger/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

passenger's People

Contributors

adamwolf avatar aeons avatar betesh avatar brendon avatar foobarwidget avatar jeanmertz avatar mherold avatar montdidier avatar nparry avatar pjkelly avatar powertoaster avatar pzgz avatar vaughany avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

passenger's Issues

Should use 'bundle exec passenger'

passenger stderr: /home/xxx/.rvm/scripts/set: line 19: exec: passenger: not found

Using capistrano/bundler my bundled gems get installed to /home/xxx/apps/xxx/shared/bundle/ruby/2.2.0/gems/passenger-5.0.4 and are not in gem list

Errors when restarting via cap but restarts ok when I ssh in...

Hey @betesh

Sorry to bother you but I don't suppose you'd have any ideas on what would be causing this? I can't restart the app via capistrano but if I ssh in using the deploy user the restart command works

I'm using the current versions of the cap gems:

capistrano (3.4.0)
capistrano-bundler (1.1.4)
capistrano-passenger (0.1.1)
capistrano-rails (1.1.3)
capistrano-rvm (0.1.2)

I'm taking over a rails 3.1 app that currently doesn't use the asset pipeline if that makes any difference - using ruby 2.0.0-p645

INFO [41d72b26] Running /usr/bin/env /usr/bin/env passenger-config restart-app /home/deployuser/public_html/mysite.com --ignore-app-not-running as [email protected]
DEBUG [41d72b26] Command: /usr/bin/env passenger-config restart-app /home/deployuser/public_html/mysite.com --ignore-app-not-running
DEBUG [41d72b26]  /usr/lib/ruby/vendor_ruby/phusion_passenger/config/restart_app_command.rb:24:in `require': no such file to load -- optparse
DEBUG [41d72b26]   (LoadError)
DEBUG [41d72b26]    from /usr/lib/ruby/vendor_ruby/phusion_passenger/config/restart_app_command.rb:24
DEBUG [41d72b26]    from /usr/lib/ruby/vendor_ruby/phusion_passenger.rb:235:in `require'

I'm guessing it's an environment issue but not sure how to rectify it...

Thanks
Luke

Could not find 'passenger'

I updated my version of passenger to 5.0.14, and updated to the latest version of capistrano/passenger. I use rvm, and have the 'rvm_ruby_version' set, along with my 'passenger_rvm_ruby_version' set. I check on my server that the new restart passenger command works, but when I do a cap deploy, I constantly get

Could not find 'passenger' (>= 0) among 6 total gem(s)
Gem::LoadError

But when I have it set to 'set :passenger_restart_with_touch, true', it works and no issues. So obviously there's still something wrong with getting this 'restart' command to work with your gem. Is there setting's I'm missing to get that to run correctly? Or is this still broke?

Deploy fails with rbenv -- passenger command not found

Hello,

I'm trying to deploy to a ubuntu server using the passenger-nginx apt repository. I'm using rbenv on the server to manage ruby. However when I try and deploy I can't get past what I think is the initial passenger command check. The error I'm getting is:

DEBUG [80178d9e] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.2 ~/.rbenv/bin/rbenv exec passenger -v )
DEBUG [80178d9e]    rbenv: passenger: command not found
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: rbenv: passenger: command not found

SSHKit::Command::Failed: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: rbenv: passenger: command not found

Tasks: TOP => passenger:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as [email protected]: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: rbenv: passenger: command not found

The passenger command works fine on the command line. Is there a option I'm missing to have the passenger restart commands to run outside of the rbenv environment?

Problem running capistrano passenger with asdf

asdf is a multi-tool manager that can handle ruby, node, etc.

They also have a capistrano package that add hooks during deployment

https://github.com/cabesa-collective/capistrano-asdf

It seems like it does not work well with capistrano passenger and cannot find the bundle

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as xxx: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: bash: line 1: bundle: command not found


Caused by:
SSHKit::Command::Failed: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: bash: line 1: bundle: command not found

Tasks: TOP => passenger:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as xxx passenger stdout: Nothing written
passenger stderr: bash: line 1: bundle: command not found

However the same command on my server with the same user works

cd /websites/xxx/releases/20220308104110 && bundle exec passenger -v
# Phusion Passenger(R) 6.0.12

Logs

How translate from global error.log in rails production.log?

passenger relative url and port

hi,

i'am running passenger via standalone.
ive custom port 3065 and also some rails instance have relative url.

how do i pass this information to capistrano-passenger?

thank you

passenger-config exits with status 1

With passenger-5.0.10 out I switched to capistrano-passenger for restarting the server. However, there are two (probably unrelated) issues with the default settings:

The task run is reported as follows:

INFO [f2fb62ba] Running /usr/bin/env /usr/bin/env passenger-config restart-app /var/www/staging.myapp.com/site --ignore-app-not-running as [email protected]

The /usr/bin/env bit is present twice. (It should work nonetheless though.)

More importantly, the above run exits with status 1:

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: /usr/bin/env passenger-config restart-app /var/www/staging.myapp.com/site --ignore-app-not-running exit status: 1
/usr/bin/env passenger-config restart-app /var/www/staging.myapp.com/site --ignore-app-not-running stdout: Nothing written
/usr/bin/env passenger-config restart-app /var/www/staging.myapp.com/site --ignore-app-not-running stderr: Usage 1: passenger-config restart-app <APP PATH PREFIX> [OPTIONS]
Usage 2: passenger-config restart-app --name <APP GROUP NAME> [OPTIONS]

  Restart an application. The syntax determines how the application that is to
  be restarted, will be selected.

  1. Selects all applications whose paths begin with the given prefix.

     Example: passenger-config restart-app /webapps
     Restarts all apps whose path begin with /webapps, such as /webapps/foo,
     /webapps/bar and /webapps123.

  2. Selects a specific application based on an exact match of its app group
     name.

     Example: passenger-config restart-app --name /webapps/foo
     Restarts only /webapps/foo, but not for example /webapps/foo/bar or
     /webapps/foo123.

Options:
        --name APP_GROUP_NAME        The app group name to select
        --rolling-restart            Perform a rolling restart instead of a
                                     regular restart (Enterprise only). The
                                     default is a blocking restart
        --instance PID               The Phusion Passenger instance to select
    -h, --help                       Show this help

When I log in with myapp_staging, I can run /usr/bin/env passenger-config restart-app /var/www/staging.myapp.com/site --ignore-app-not-running without any problems.

I'm not sure what other config or debug details might be helpful here, but I'd be happy to provide whatever needed.

New restart option in Passenger 5.0.13: --ignore-passenger-not-running

In the next of version of Passenger (5.0.13), passenger-config restart-app will support the option --ignore-passenger-not-running. This allows passenger-config restart-app to exit with code 0 even if Passenger is not running.

It is mostly useful in deployments involving Passenger Standalone. If a user runs cap deploy for the first time, Passenger Standalone will not be running, in which case passenger-config restart-app will fail. By using this command line option, passenger-config restart-app will ignore that failure.

This option is to be used in combination with --ignore-app-not-running.

I suggest that capistrano-passenger changes the default restart options to --ignore-app-not-running --ignore-passenger-not-running.

Relevant commit: phusion/passenger@0b43cb4

With multiple processes

I have read: https://www.phusionpassenger.com/library/walkthroughs/basics/ruby/process_management.html
I have tried running the command bundle exec passenger start --min-instances 2 in the instance but it raised error as below:

=============== Phusion Passenger Standalone web server started ===============
PID file: /var/www/estatedraw-v2/current/tmp/pids/passenger.3000.pid
Log file: /var/www/estatedraw-v2/current/log/passenger.3000.log
Environment: development
Accessible via: http://0.0.0.0:3000/

You can stop Phusion Passenger Standalone by pressing Ctrl-C.
Problems? Check https://www.phusionpassenger.com/library/admin/standalone/troubleshooting/
===============================================================================
App 17804 stdout: 
[ 2018-03-12 04:18:17.7180 17761/7f7ad48ce700 age/Cor/SecurityUpdateChecker.h:358 ]: A security update is available for your version (5.1.6) of Passenger, we strongly recommend upgrading to version 5.2.1.
[ 2018-03-12 04:18:17.7180 17761/7f7ad48ce700 age/Cor/SecurityUpdateChecker.h:363 ]:  Additional information: 
- [Fixed in 5.1.11] [URGENT] Users with write access to an application can view arbitrary files on the system if Passenger is running as root.
App 17804 stdout: 
[ 2018-03-12 04:18:20.4553 17761/7f7acc23d700 age/Cor/App/Implementation.cpp:304 ]: Could not spawn process for application /var/www/estatedraw-v2/current: An error occurred while starting up the preloader.
  Error ID: e9cee348
  Error details saved to: /tmp/passenger-error-CbzdTI.html
  Message from application: Could not load the 'listen' gem. Add `gem 'listen'` to the development group of your Gemfile (LoadError)
  /var/www/estatedraw-v2/shared/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `require'
  /var/www/estatedraw-v2/shared/bundle/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/dependencies.rb:292:in `block in require'
  /var/www/estatedraw-v2/shared/bundle/ruby/2.3.0/gems/activesupport-
--------------

[ 2018-03-12 04:18:20.4617 17761/7f7acd5c9700 age/Cor/Con/CheckoutSession.cpp:285 ]: [Client 1-1] Cannot checkout session because a spawning error occurred. The identifier of the error is e9cee348. Please see earlier logs for details about the error.

RVM gem not found problem

Im using capistrano-passenger 0.2.0, capistrano 3.8.1 and passenger 5.1.3 in standalone mode.

My deploy.rb contains:

set :rvm_ruby_version, 'ruby-2.3.0'
set :passenger_rvm_ruby_version, fetch(:rvm_ruby_version)
set :passenger_in_gemfile, true

When I run cap production deploy I get the follow error:

00:56 passenger:restart
      01 bundle exec passenger-config restart-app /var/sites/teeshirtacademy --ignore-app-not-running
      01 /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in `block in materialize': Could not find tzinfo-1.2.3 in any of the sources (Bundler::GemNotFoun…
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `map!'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `materialize'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'
      01 	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'
      01 	from /home/git/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
      01 	from /home/git/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'
(Backtrace restricted to imported tasks)

...

** DEPLOY FAILED
** Refer to log/capistrano.log for details. Here are the last 20 lines:


 DEBUG [7759494d] Command: if test ! -d /var/sites/teeshirtacademy/releases/20170504150957; then echo "Directory does not exist '/var/sites/teeshirtacademy/releases/20170504150957'" 1>&2; false; fi

 DEBUG [7759494d] Finished in 0.266 seconds with exit status 0 (successful).

 DEBUG [a6d32250] Running ~/.rvm/bin/rvm ruby-2.3.0 do bundle exec bundle exec passenger -v as [email protected]

 DEBUG [a6d32250] Command: cd /var/sites/teeshirtacademy/releases/20170504150957 && ~/.rvm/bin/rvm ruby-2.3.0 do bundle exec bundle exec passenger -v

 DEBUG [a6d32250] 	Phusion Passenger 5.1.3

 DEBUG [a6d32250] Finished in 2.240 seconds with exit status 0 (successful).

  INFO [00c0589d] Running bundle exec passenger-config restart-app /var/sites/teeshirtacademy --ignore-app-not-running as [email protected]

 DEBUG [00c0589d] Command: cd /var/sites/teeshirtacademy/releases/20170504150957 && bundle exec passenger-config restart-app /var/sites/teeshirtacademy --ignore-app-not-running

 DEBUG [00c0589d] 	/home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/spec_set.rb:94:in `block in materialize': Could not find tzinfo-1.2.3 in any of the sources (Bundler::GemNotFound)

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `map!'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/spec_set.rb:87:in `materialize'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/definition.rb:137:in `specs'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/definition.rb:182:in `specs_for'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/definition.rb:171:in `requested_specs'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/environment.rb:18:in `requested_specs'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/runtime.rb:13:in `setup'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler.rb:92:in `setup'

	from /home/git/.rvm/gems/ruby-2.1.2/gems/bundler-1.11.2/lib/bundler/setup.rb:18:in `<top (required)>'

	from /home/git/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

	from /home/git/.rvm/rubies/ruby-2.1.2/lib/ruby/2.1.0/rubygems/core_ext/kernel_require.rb:55:in `require'

Any idea? The task to restart use ruby-2.1.2 but the project run with rvm-2.3.0...

Passenger-restart happens on previous release, not the one that is just deployed

I noticed that the passenger:restart task restarts the previous revision of the app, and not the one just deployed.

This is the output when I run cap production deploy

...
...
00:35 deploy:symlink:release
      01 ln -s /var/www/appname/releases/20170513151848 /var/www/appname/…
    ✔ 01 user@xxxxxx 0.223s
      02 mv /var/www/appname/releases/current /var/www/appname
    ✔ 02 user@xxxxxx 0.214s
00:36 passenger:restart
      01 passenger-config restart-app /var/www/appname --ignore-app-not-running
      01 Restarting /var/www/appname/releases/20170513143827/public (production)
    ✔ 01 user@xxxxxx 0.416s
00:36 deploy:restart_redis
...
...

Notice that the Restarting /var/www/appname/releases/20170513143827/public has a different release to the one that was just deployed (20170513151848).

This is my nginx config for the app:

server {
	listen 80 default;
	listen [::]:80;

	# SSL configuration
	ssl on;
	listen 443 ssl;
       # Server config
	server_name www.servername.com;
	root /var/www/appname/current/public;
...
...

Here is my capfile:

# Load DSL and set up stages
require "capistrano/setup"

# Include default deployment tasks
require "capistrano/deploy"

# Include capistrano-rails
require 'capistrano/rails'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/migrations'
require 'capistrano/rails/assets'

require 'capistrano/bundler'
require 'capistrano/passenger'

# Load the SCM plugin appropriate to your project:
require "capistrano/scm/git"
install_plugin Capistrano::SCM::Git

# Load custom tasks from `lib/capistrano/tasks` if you have any defined
Dir.glob("lib/capistrano/tasks/*.rake").each { |r| import r }

My gem file: (running rails 5)

group :development do
  gem 'listen', '~> 3.0.5'
  # Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
  # gem 'spring'
  # gem 'spring-watcher-listen', '~> 2.0.0'
  # Capistrano for deployment
  gem 'capistrano', '~> 3.6'
  gem 'capistrano-rails', '~> 1.1'
  gem 'capistrano-rvm', '~> 0.1.0'
  gem 'capistrano-bundler'
  gem 'capistrano-passenger', '>= 0.1.1'
end

The task is not using the correct revision of the app to deploy.

PSA: passenger from Ubuntu 16.04 repo does not provide /usr/bin/passenger

I just stumbled over this:

The Ubuntu native package passenger (5.0.27-2) doesn't provide a passenger binary. This is relevant, if fetch(:passenger_restart_with_touch) is nil, i.e. you don't have an explicit

set :passenger_restart_with_touch, false # or true

in your Capistrano configuration. Otherwise capture(:passenger, '-v') will be executed and fail with

SSHKit::Runner::ExecuteError: Exception while executing on host xxx: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: /usr/bin/env: 'passenger': No such file or directory

Could not find 'passenger' on Debian

I'm trying to deploy to a Debian Jessie host, using the passenger from Debians 'ruby-passenger' package. The application itself uses Ruby 2.3.0 from rvm, if I read the rvm documentation correctly this should be possible?

But cap deploy fails with

SSHKit::Command::Failed: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: /home/frab/.rvm/scripts/set: line 19: exec: passenger: not found

There is no passenger binary included in the Debian package at all: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=793013

Using rvm but passenger is installed as an nginx module

Morning all

I've got a probably non standard setup.

I install nginx from source, and during that install add the passenger module, by pointing it at a downloaded passenger source code. I find it easier to upgrade nginx and passenger like this.

I'm using passenger 5 and running multiple apps with different rubies, installed via rvm.

I can't seem to get the restart to work.

First of all it was saying that passenger isn't installed. Ok, so I added the path to my source to /etc/profile.d

On the server as the same user that does the deploy, if I run which passenger I get a reply.

/src/passenger-5.0.7/bin/passenger

But the restart keeps on failing

[8ae70cfc] Running /usr/bin/env which passenger as [email protected]
DEBUG [8ae70cfc] Command: /usr/bin/env which passenger
DEBUG [8ae70cfc] Finished in 0.641 seconds with exit status 1 (failed).

I know it must be extremely difficult to get this to work with all our crazy differences, but should I persevere here, and keep on trying all the different options? Or, just accept that it's not ready for this type of setup, and touch tmp/restart.txt?

I'd like to use the new stuff, but I'm struggling. If anyone has worked this out I'm all ears.

Regards

Matt

Passenger 4 Issue with capistrano-passenger 0.0.4

We currently deploy with capistrano-passenger 0.0.2 . When we update capistrano-passenger to 0.0.4, we get the following error:

DEBUG [cd2a345d] Running /usr/bin/env passenger -v on 5.22.150.180
DEBUG [cd2a345d] Command: /usr/bin/env passenger -v
DEBUG [cd2a345d]     /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs'
DEBUG [cd2a345d]     : 
DEBUG [cd2a345d]     Could not find 'passenger' (>= 0) among 15 total gem(s)
DEBUG [cd2a345d]      (
DEBUG [cd2a345d]     Gem::LoadError
DEBUG [cd2a345d]     )
DEBUG [cd2a345d]     
DEBUG [cd2a345d]         
DEBUG [cd2a345d]     from /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
DEBUG [cd2a345d]     
DEBUG [cd2a345d]         
DEBUG [cd2a345d]     from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
DEBUG [cd2a345d]     
DEBUG [cd2a345d]         
DEBUG [cd2a345d]     from /usr/local/bin/passenger:22:in `<main>'
DEBUG [cd2a345d]     
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing on host 5.22.150.180: passenger exit status: 1
passenger stdout: /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'passenger' (>= 0) among 15 total gem(s) (Gem::LoadError)
    from /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /usr/local/bin/passenger:22:in `<main>'
passenger stderr: Nothing written

SSHKit::Command::Failed: passenger exit status: 1
passenger stdout: /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'passenger' (>= 0) among 15 total gem(s) (Gem::LoadError)
    from /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /usr/local/bin/passenger:22:in `<main>'
passenger stderr: Nothing written

Tasks: TOP => passenger:restart
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing on host 5.22.150.180: passenger exit status: 1
passenger stdout: /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:298:in `to_specs': Could not find 'passenger' (>= 0) among 15 total gem(s) (Gem::LoadError)
    from /usr/local/lib/ruby/2.1.0/rubygems/dependency.rb:309:in `to_spec'
    from /usr/local/lib/ruby/2.1.0/rubygems/core_ext/kernel_gem.rb:53:in `gem'
    from /usr/local/bin/passenger:22:in `<main>'
passenger stderr: Nothing written

Downgrading to 0.0.2 fixes the problem.

We have Passenger 4 installed on our servers.

/usr/bin/env: passenger: No such file or directory

[email protected]

My rvm check is running, and passenger is installed where its supposed to be:

$ cap staging rvm:check
DEBUG [e7855c0a] Running /usr/bin/env which passenger as [email protected]
DEBUG [e7855c0a] Command: /usr/bin/env which passenger
DEBUG [e7855c0a]  /usr/local/bin/passenger
DEBUG [e7855c0a] Finished in 4.899 seconds with exit status 0 (successful).
DEBUG [eb1946f6] Running /usr/bin/env [ -d ~/.rvm ] as [email protected]
DEBUG [eb1946f6] Command: [ -d ~/.rvm ]
DEBUG [eb1946f6] Finished in 0.048 seconds with exit status 1 (failed).
DEBUG [83b81b8f] Running /usr/bin/env [ -d /usr/local/rvm ] as [email protected]
DEBUG [83b81b8f] Command: [ -d /usr/local/rvm ]
DEBUG [83b81b8f] Finished in 0.048 seconds with exit status 0 (successful).
DEBUG [21c55ccb] Running /usr/local/rvm/bin/rvm version as [email protected]
DEBUG [21c55ccb] Command: /usr/local/rvm/bin/rvm version
DEBUG [21c55ccb]  rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [21c55ccb] Finished in 0.217 seconds with exit status 0 (successful).
rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [2e435386] Running /usr/local/rvm/bin/rvm current as [email protected]
DEBUG [2e435386] Command: /usr/local/rvm/bin/rvm current
DEBUG [2e435386]  ruby-2.2.1
DEBUG [2e435386] Finished in 0.215 seconds with exit status 0 (successful).
ruby-2.2.1
DEBUG [842673be] Running /usr/local/rvm/bin/rvm default do ruby --version as [email protected]
DEBUG [842673be] Command: /usr/local/rvm/bin/rvm default do ruby --version
DEBUG [842673be]  ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
DEBUG [842673be] Finished in 0.335 seconds with exit status 0 (successful).
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

However when I execute my deploy:

$ cap staging deploy --trace
** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Invoke passenger:rvm:hook (first_time)
** Invoke passenger:test_which_passenger (first_time)
** Execute passenger:test_which_passenger
DEBUG [40e61c81] Running /usr/bin/env which passenger as [email protected]
DEBUG [40e61c81] Command: /usr/bin/env which passenger
DEBUG [40e61c81]  /usr/local/bin/passenger
DEBUG [40e61c81] Finished in 4.941 seconds with exit status 0 (successful).
... // a bunch of deploy logs

** Execute passenger:restart
DEBUG [44ab1d36] Running /usr/bin/env if test ! -d /srv/www/bar.com/releases/20150618180137; then echo "Directory does not exist '/srv/www/bar.com/releases/20150618180137'" 1>&2; false; fi as [email protected]
DEBUG [44ab1d36] Command: if test ! -d /srv/www/bar.com/releases/20150618180137; then echo "Directory does not exist '/srv/www/bar.com/releases/20150618180137'" 1>&2; false; fi
DEBUG [44ab1d36] Finished in 0.049 seconds with exit status 0 (successful).
DEBUG [26d61b09] Running /usr/bin/env passenger -v as [email protected]
DEBUG [26d61b09] Command: cd /srv/www/bar.com/releases/20150618180137 && /usr/bin/env passenger -v
DEBUG [26d61b09]  /usr/bin/env: passenger: No such file or directory
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as [email protected]: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: /usr/bin/env: passenger: No such file or directory
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:24:in `rescue in run_backend'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:21:in `run_backend'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:16:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/coordinator.rb:21:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:55:in `on'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/passenger.cap:11:in `block (2 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/deploy_passenger.cap:6:in `block (2 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl/task_enhancements.rb:14:in `block in after'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:65:in `block (2 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:64:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:64:in `block in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/cap:23:in `load'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/cap:23:in `<main>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
SSHKit::Command::Failed: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: /usr/bin/env: passenger: No such file or directory
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/command.rb:95:in `exit_status='
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:179:in `block in _execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `tap'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:133:in `_execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:77:in `capture'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/passenger.cap:15:in `block (5 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:77:in `within'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/passenger.cap:13:in `block (4 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/passenger.cap:12:in `block (3 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:21:in `run_backend'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:16:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/sshkit-1.7.1/lib/sshkit/coordinator.rb:21:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:55:in `on'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/passenger.cap:11:in `block (2 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-passenger-0.1.0/lib/capistrano/tasks/deploy_passenger.cap:6:in `block (2 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl/task_enhancements.rb:14:in `block in after'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:65:in `block (2 levels) in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:64:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:64:in `block in <top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/jspizziri/.rvm/rubies/ruby-2.1.0/lib/ruby/2.1.0/monitor.rb:211:in `mon_synchronize'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/cap:23:in `load'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/cap:23:in `<main>'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `eval'
/Users/jspizziri/.rvm/gems/ruby-2.1.0/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => passenger:restart
The deploy has failed with an error: Exception while executing as [email protected]: passenger exit status: 127
passenger stdout: Nothing written
passenger stderr: /usr/bin/env: passenger: No such file or directory
** Invoke deploy:failed (first_time)
** Execute deploy:failed

2a979f5 breaks package-installed passnger

When passenger is installed form a package (eg apt-get), passenger is not available in the path so can't get the version number. You can specify this in env variables, however in this instance, running passenger -v, still wouldn't return anything.

Perhaps the option to specify which version of passenger is being used, rather than trying to detect. (or a command that lets you specify the version) eg dpkg -l | grep passenger or similar.

passenger restart problems

I installed passenger from rvm. rvm_type is system
When I call it from deploy user command exists.

From cap script I getting this error:

DEBUG [b141b962] Command: passenger-config restart-app
DEBUG [b141b962]    bash: passenger-config: command not found

When I tried to set path to passenger config, I got this:

DEBUG [73ebbfcd] Command: /usr/local/rvm/gems/ruby-2.2.1/bin/passenger-config restart-app
DEBUG [73ebbfcd]    /usr/bin/env: ruby_executable_hooks
DEBUG [73ebbfcd]    : No such file or directory

rvm_hook output:

DEBUG [f80d9333] Running /usr/local/rvm/bin/rvm version as 
DEBUG [f80d9333] Command: /usr/local/rvm/bin/rvm version
DEBUG [f80d9333]    rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [f80d9333] Finished in 1.724 seconds with exit status 0 (successful).
rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [4fc78198] Running /usr/local/rvm/bin/rvm current as 
DEBUG [4fc78198] Command: /usr/local/rvm/bin/rvm current
DEBUG [4fc78198]    ruby-2.2.1
DEBUG [4fc78198] Finished in 0.679 seconds with exit status 0 (successful).
ruby-2.2.1
DEBUG [f83a8bea] Running /usr/local/rvm/bin/rvm default do ruby --version as 
DEBUG [f83a8bea] Command: /usr/local/rvm/bin/rvm default do ruby --version
DEBUG [f83a8bea]    ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
DEBUG [f83a8bea] Finished in 1.024 seconds with exit status 0 (successful).
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

passenger restart using touch tmp/restart.txt when passenger-config is available

The restart command checks if the version is greater than 4 (so it needs 5, not 4.x). We are running 4.0.59 and this command works perfectly for us:

sudo passenger-config restart-app /var/www/staging --ignore-app-not-running

However, due to the precondition check, the deploy:restart still does a touch tmp/restart.txt, which doesn't seem to work in our case (that is, we don't see a restart of the Passenger instances, their started-at date stays at the old date).

update okay, after reading some more, I now understand that touch tmp/restart.txt actually does a restart of the Passenger instance on the next incoming request. So this is why we didn't see a restart before initialising a new request. It now restarts correctly. However, since passenger-config is present and working (and seems to be the better option of the two), I think there should be a way to force using that method if it's available.

passenger:restart fails with current sshkit and passenger_in_gemfile=false (Directory does not exist)

Reason: within('') fails with the current sshkit version. I opened an issue in sshkit (capistrano/sshkit#476), but the current opinion seems to be that instead of within('') one should instead explicitly use within(capture(:pwd)).

@betesh what do you think, since you made the last change regarding this?

within(fetch(:passenger_in_gemfile, false) ? release_path : "") do

cap deploy fails due to 2 passenger instances running

Not sure how this can be solved, but here is the error output from cap deploy :

DEBUG [8342f1fc]        It appears that multiple Phusion Passenger instances are running. Please select
DEBUG [8342f1fc]        a specific one by passing:
DEBUG [8342f1fc]
DEBUG [8342f1fc]          --instance <NAME>
DEBUG [8342f1fc]
DEBUG [8342f1fc]        The following Phusion Passenger instances are running:
DEBUG [8342f1fc]
DEBUG [8342f1fc]        Name                       Description
DEBUG [8342f1fc]        ------------------------------------------------------------------
DEBUG [8342f1fc]        Hti7gcXg                   nginx/1.8.0 Phusion_Passenger/5.0.14
DEBUG [8342f1fc]        WnX8S9fI                   Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.14
(Backtrace restricted to imported tasks)
cap aborted!

So on the server, I see the two instances :

$ passenger-status
It appears that multiple Phusion Passenger instances are running. Please
select a specific one by running:

  passenger-status <NAME>

The following instances are running:

Name                       Description
------------------------------------------------------------------
Hti7gcXg                   nginx/1.8.0 Phusion_Passenger/5.0.14
WnX8S9fI                   Apache/2.4.7 (Ubuntu) Phusion_Passenger/5.0.14

And can manually restart :

$ passenger-config restart-app --instance Hti7gcXg .
Restarting /srv/www/myapp/current/public

But of course the instance name could change, so cannot be hard coded into the cap deploy scripts.

is managing passenger _and_ standalone simultaneously possible with capistrano?

Can you clarify if managing, namely restarting, (regular) passenger and standalone possible with this module? If so, how?

I need two run the two due to using cable/websockets.

I can't claim I fully understand capistrano (or even much of it, my cap mojo is tiny), but it has worked very well for me for years now with passenger. Looking at the README, it appears that you guys address the issue of running passenger standalone, seemingly by itself.

Is it possible?

The reason I need to do this is that recently, I had to add support for ActionCable to one of my apps, and to support the websocket part, it appears that running a separate version of passenger (or other server, like puma) is the recommended approach and after trying them, passenger seems to work well.

I settled with passenger running bin/cable as a script like this:

#!/bin/bash
export RAILS_ENV=production
exec bundle exec passenger start -p 9999 --daemonize -R cable/config.ru --force-max-concurrent-requests-per-process 0

Anyone know how to do this in a safe way with capistrano?

I tried to do it by hand with:

$ passenger-config list-instances
... (only shows one name of an app, and it seems to be the standalone) ...

$ passenger-config restart-app --instance xyz123

however, I get some interactive question about what app to restart (and does not work).

I am currently restarting it with:

export RAILS_ENV=production
bundle exec passenger stop -p 9999
sleep 2
exec bundle exec passenger start -p 9999 --daemonize -R cable/config.ru --force-max-concurrent-requests-per-process 0

passenger version & dry-run: undefined method `[]' for nil:NilClass

I was running a dry-run with the following configuration and got an unexpected exception while running deploy:

/home/michael/.rvm/gems/ruby-1.9.3-p551/bin/cap development deploy --dry-run --trace

Capfile

require 'capistrano/setup'
require 'capistrano/deploy'

require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'

config/deploy.rb

lock '3.4.0'

set :application, 'project'

set :repo_url, '[email protected]:organization/project.git'

set :deploy_to, '/var/www/project'

config/deploy/development.rb

server 'host', user: 'user', roles: %w{app db web}

set :deploy_to, '/var/www/dev.project'

Log

  INFO [188d35fb] Running /usr/bin/env which passenger as user@host
** Invoke development (first_time)
 DEBUG [188d35fb] Command: /usr/bin/env which passenger
** Execute development
  INFO [2af5a0f7] Running /usr/bin/env [ -d ~/.rvm ] as user@host
** Invoke load:defaults (first_time)
 DEBUG [2af5a0f7] Command: [ -d ~/.rvm ]
** Execute load:defaults
  INFO [23fe168e] Running ~/.rvm/bin/rvm version as user@host
** Invoke rvm:hook (first_time)
 DEBUG [23fe168e] Command: ~/.rvm/bin/rvm version
** Invoke passenger:rvm:hook (first_time)

** Execute passenger:rvm:hook
  INFO [6044c812] Running ~/.rvm/bin/rvm current as user@host
** Execute rvm:hook
 DEBUG [6044c812] Command: ~/.rvm/bin/rvm current
** Invoke rvm:check (first_time)

** Execute rvm:check
  INFO [7c274162] Running ~/.rvm/bin/rvm default do ruby --version as user@host
** Invoke bundler:map_bins (first_time)
 DEBUG [7c274162] Command: ~/.rvm/bin/rvm default do ruby --version
** Execute bundler:map_bins

** Invoke deploy:set_rails_env (first_time)
  INFO [3ac326a7] Running /usr/bin/env mkdir -p /tmp/project/ as user@host
** Execute deploy:set_rails_env
 DEBUG [3ac326a7] Command: /usr/bin/env mkdir -p /tmp/project/
** Invoke deploy:set_rails_env 
** Invoke deploy (first_time)
  INFO [35443c3b] Running /usr/bin/env #<StringIO:0x000000017cd2f0> /tmp/project/git-ssh.sh as user@host
** Execute deploy
 DEBUG [35443c3b] Command: /usr/bin/env #<StringIO:0x000000017cd2f0> /tmp/project/git-ssh.sh
** Invoke deploy:starting (first_time)
** Execute deploy:starting
** Invoke deploy:check (first_time)
** Execute deploy:check
** Invoke git:check (first_time)
** Invoke git:wrapper (first_time)
** Execute git:wrapper
  INFO [cddac1d3] Running /usr/bin/env chmod +x /tmp/project/git-ssh.sh as user@host
 DEBUG [cddac1d3] Command: /usr/bin/env chmod +x /tmp/project/git-ssh.sh
** Execute git:check
  INFO [bd35090c] Running /usr/bin/env git ls-remote --heads [email protected]:organization/project.git as user@host
 DEBUG [bd35090c] Command: ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /usr/bin/env git ls-remote --heads [email protected]:organization/project.git )
  INFO [1c674eb0] Running /usr/bin/env mkdir -p /var/www/dev.project/shared /var/www/dev.project/releases as user@host
 DEBUG [1c674eb0] Command: /usr/bin/env mkdir -p /var/www/dev.project/shared /var/www/dev.project/releases
  INFO [60e6e662] Running /usr/bin/env mkdir -p /var/www/dev.project/shared/public/assets as user@host
 DEBUG [60e6e662] Command: /usr/bin/env mkdir -p /var/www/dev.project/shared/public/assets
  INFO [9be3788b] Running /usr/bin/env [ -f /var/www/dev.project/current/REVISION ] as user@host
 DEBUG [9be3788b] Command: [ -f /var/www/dev.project/current/REVISION ]
  INFO [ba40c474] Running /usr/bin/env cat /var/www/dev.project/current/REVISION 2>/dev/null as user@host
 DEBUG [ba40c474] Command: /usr/bin/env cat /var/www/dev.project/current/REVISION 2>/dev/null
  INFO [57a186f0] Running /usr/bin/env [ -f /var/www/dev.project/repo/HEAD ] as user@host
 DEBUG [57a186f0] Command: [ -f /var/www/dev.project/repo/HEAD ]
  INFO The repository mirror is at /var/www/dev.project/repo
 DEBUG [2c073709] Running /usr/bin/env if test ! -d /var/www/dev.project/repo; then echo "Directory does not exist '/var/www/dev.project/repo'" 1>&2; false; fi as user@host
 DEBUG [2c073709] Command: if test ! -d /var/www/dev.project/repo; then echo "Directory does not exist '/var/www/dev.project/repo'" 1>&2; false; fi
  INFO [1e05b25a] Running /usr/bin/env git remote update as user@host
 DEBUG [1e05b25a] Command: cd /var/www/dev.project/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /usr/bin/env git remote update )
 DEBUG [a36ced43] Running /usr/bin/env if test ! -d /var/www/dev.project/repo; then echo "Directory does not exist '/var/www/dev.project/repo'" 1>&2; false; fi as user@host
 DEBUG [a36ced43] Command: if test ! -d /var/www/dev.project/repo; then echo "Directory does not exist '/var/www/dev.project/repo'" 1>&2; false; fi
  INFO [b2b5fe61] Running /usr/bin/env mkdir -p /var/www/dev.project/releases/20150519092353 as user@host
 DEBUG [b2b5fe61] Command: cd /var/www/dev.project/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /usr/bin/env mkdir -p /var/www/dev.project/releases/20150519092353 )
  INFO [8439eb54] Running /usr/bin/env git archive master | tar -x -f - -C /var/www/dev.project/releases/20150519092353 as user@host
 DEBUG [8439eb54] Command: cd /var/www/dev.project/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /usr/bin/env git archive master | tar -x -f - -C /var/www/dev.project/releases/20150519092353 )
** Invoke deploy:check:directories (first_time)
** Execute deploy:check:directories
** Invoke deploy:check:linked_dirs (first_time)
** Execute deploy:check:linked_dirs
** Invoke deploy:check:make_linked_dirs (first_time)
** Execute deploy:check:make_linked_dirs
** Invoke deploy:check:linked_files (first_time)
** Execute deploy:check:linked_files
** Invoke deploy:set_previous_revision (first_time)
** Execute deploy:set_previous_revision
** Invoke deploy:started (first_time)
** Execute deploy:started
** Invoke deploy:updating (first_time)
** Invoke deploy:new_release_path (first_time)
** Execute deploy:new_release_path
** Execute deploy:updating
** Invoke git:create_release (first_time)
** Invoke git:update (first_time)
** Invoke git:clone (first_time)
** Invoke git:wrapper 
** Execute git:clone
** Execute git:update
** Execute git:create_release
** Invoke deploy:set_current_revision (first_time)
** Execute deploy:set_current_revision
** Invoke git:set_current_revision (first_time)
** Execute git:set_current_revision
 DEBUG [604f2f3e] Running /usr/bin/env if test ! -d /var/www/dev.project/repo; then echo "Directory does not exist '/var/www/dev.project/repo'" 1>&2; false; fi as user@host
 DEBUG [604f2f3e] Command: if test ! -d /var/www/dev.project/repo; then echo "Directory does not exist '/var/www/dev.project/repo'" 1>&2; false; fi
  INFO [f2b9cb5b] Running /usr/bin/env git rev-list --max-count=1 --abbrev-commit master as user@host
 DEBUG [f2b9cb5b] Command: cd /var/www/dev.project/repo && ( GIT_ASKPASS=/bin/echo GIT_SSH=/tmp/project/git-ssh.sh /usr/bin/env git rev-list --max-count=1 --abbrev-commit master )
 DEBUG [4ccfba9d] Running /usr/bin/env if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi as user@host
 DEBUG [4ccfba9d] Command: if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi
  INFO [2759a50e] Running /usr/bin/env echo "" >> REVISION as user@host
 DEBUG [2759a50e] Command: cd /var/www/dev.project/releases/20150519092353 && /usr/bin/env echo "" >> REVISION
** Invoke deploy:symlink:shared (first_time)
** Execute deploy:symlink:shared
** Invoke deploy:symlink:linked_files (first_time)
** Execute deploy:symlink:linked_files
** Invoke deploy:symlink:linked_dirs (first_time)
** Execute deploy:symlink:linked_dirs
  INFO [f1a9d27e] Running /usr/bin/env mkdir -p /var/www/dev.project/releases/20150519092353/public as user@host
 DEBUG [f1a9d27e] Command: /usr/bin/env mkdir -p /var/www/dev.project/releases/20150519092353/public
  INFO [401eabce] Running /usr/bin/env [ -L /var/www/dev.project/releases/20150519092353/public/assets ] as user@host
 DEBUG [401eabce] Command: [ -L /var/www/dev.project/releases/20150519092353/public/assets ]
 DEBUG [6fa0d28d] Running /usr/bin/env if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi as user@host
 DEBUG [6fa0d28d] Command: if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi
  INFO [c2fb92dc] Running ~/.rvm/bin/rvm default do bundle install --path /var/www/dev.project/shared/bundle --without development test --deployment --quiet as user@host
 DEBUG [c2fb92dc] Command: cd /var/www/dev.project/releases/20150519092353 && ~/.rvm/bin/rvm default do bundle install --path /var/www/dev.project/shared/bundle --without development test --deployment --quiet
** Invoke deploy:updated (first_time)
** Invoke bundler:install (first_time)
** Execute bundler:install
** Execute deploy:updated
** Invoke deploy:compile_assets (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:compile_assets
** Invoke deploy:assets:precompile (first_time)
** Execute deploy:assets:precompile
 DEBUG [2ae3124e] Running /usr/bin/env if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi as user@host
 DEBUG [2ae3124e] Command: if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi
  INFO [8996e9a0] Running ~/.rvm/bin/rvm default do bundle exec rake assets:precompile as user@host
 DEBUG [8996e9a0] Command: cd /var/www/dev.project/releases/20150519092353 && ( RAILS_ENV=development ~/.rvm/bin/rvm default do bundle exec rake assets:precompile )
 DEBUG [b0e3cb89] Running /usr/bin/env if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi as user@host
 DEBUG [b0e3cb89] Command: if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi
  INFO [6172eb12] Running /usr/bin/env mkdir -p /var/www/dev.project/releases/20150519092353/assets_manifest_backup as user@host
 DEBUG [6172eb12] Command: cd /var/www/dev.project/releases/20150519092353 && /usr/bin/env mkdir -p /var/www/dev.project/releases/20150519092353/assets_manifest_backup
  INFO [1ff87779] Running /usr/bin/env ls /var/www/dev.project/releases/20150519092353/public/assets/.sprockets-manifest* as user@host
 DEBUG [1ff87779] Command: cd /var/www/dev.project/releases/20150519092353 && /usr/bin/env ls /var/www/dev.project/releases/20150519092353/public/assets/.sprockets-manifest*
** Invoke deploy:assets:backup_manifest (first_time)
** Execute deploy:assets:backup_manifest
  INFO [fbdf5edb] Running /usr/bin/env ls /var/www/dev.project/releases/20150519092353/public/assets/.sprockets-manifest* as user@host
 DEBUG [fbdf5edb] Command: cd /var/www/dev.project/releases/20150519092353 && /usr/bin/env ls /var/www/dev.project/releases/20150519092353/public/assets/.sprockets-manifest*
  INFO [30d49a60] Running /usr/bin/env cp  /var/www/dev.project/releases/20150519092353/assets_manifest_backup as user@host
 DEBUG [30d49a60] Command: cd /var/www/dev.project/releases/20150519092353 && /usr/bin/env cp  /var/www/dev.project/releases/20150519092353/assets_manifest_backup
  INFO [deploy:migrate] Run `rake db:migrate`
 DEBUG [24d35478] Running /usr/bin/env if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi as user@host
 DEBUG [24d35478] Command: if test ! -d /var/www/dev.project/releases/20150519092353; then echo "Directory does not exist '/var/www/dev.project/releases/20150519092353'" 1>&2; false; fi
  INFO [f4ad4959] Running ~/.rvm/bin/rvm default do bundle exec rake db:migrate as user@host
 DEBUG [f4ad4959] Command: cd /var/www/dev.project/releases/20150519092353 && ( RAILS_ENV=development ~/.rvm/bin/rvm default do bundle exec rake db:migrate )
** Invoke deploy:normalize_assets (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:normalize_assets
** Invoke deploy:migrate (first_time)
** Invoke deploy:set_rails_env 
** Execute deploy:migrate
** Invoke deploy:publishing (first_time)
** Execute deploy:publishing
** Invoke deploy:symlink:release (first_time)
** Execute deploy:symlink:release
  INFO [2c25ed5e] Running /usr/bin/env ln -s /var/www/dev.project/releases/20150519092353 /var/www/dev.project/releases/current as user@host
 DEBUG [2c25ed5e] Command: /usr/bin/env ln -s /var/www/dev.project/releases/20150519092353 /var/www/dev.project/releases/current
  INFO [4079994c] Running /usr/bin/env mv /var/www/dev.project/releases/current /var/www/dev.project as user@host
 DEBUG [4079994c] Command: /usr/bin/env mv /var/www/dev.project/releases/current /var/www/dev.project
  INFO [ef7d289d] Running /usr/bin/env passenger -v as user@host
 DEBUG [ef7d289d] Command: /usr/bin/env passenger -v
** Invoke deploy:restart (first_time)
** Execute deploy:restart
** Invoke passenger:restart (first_time)
** Execute passenger:restart

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as user@host: undefined method `[]' for nil:NilClass
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:24:in `rescue in run_backend'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:21:in `run_backend'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:16:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/coordinator.rb:15:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:55:in `on'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-passenger-0.0.5/lib/capistrano/tasks/passenger.cap:4:in `block (2 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-passenger-0.0.5/lib/capistrano/tasks/deploy_passenger.cap:6:in `block (2 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl/task_enhancements.rb:14:in `block in after'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:65:in `block (2 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:61:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:61:in `block in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/bin/cap:23:in `load'
/home/michael/.rvm/gems/ruby-1.9.3-p551/bin/cap:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
NoMethodError: undefined method `[]' for nil:NilClass
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-passenger-0.0.5/lib/capistrano/tasks/passenger.cap:6:in `block (4 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-passenger-0.0.5/lib/capistrano/tasks/passenger.cap:5:in `block (3 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/backends/printer.rb:9:in `instance_exec'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/backends/printer.rb:9:in `run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:21:in `run_backend'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:16:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/sshkit-1.7.1/lib/sshkit/coordinator.rb:15:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:55:in `on'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-passenger-0.0.5/lib/capistrano/tasks/passenger.cap:4:in `block (2 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-passenger-0.0.5/lib/capistrano/tasks/deploy_passenger.cap:6:in `block (2 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl/task_enhancements.rb:14:in `block in after'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:16:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:65:in `block (2 levels) in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:61:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/tasks/framework.rake:61:in `block in <top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `call'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:240:in `block in execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:235:in `execute'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:179:in `block in invoke_with_call_chain'
/home/michael/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/monitor.rb:211:in `mon_synchronize'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:172:in `invoke_with_call_chain'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/task.rb:165:in `invoke'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:150:in `invoke_task'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in `block (2 levels) in top_level'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in `each'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:106:in `block in top_level'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:115:in `run_with_threads'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:100:in `top_level'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:78:in `block in run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:176:in `standard_exception_handling'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/rake-10.4.2/lib/rake/application.rb:75:in `run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/home/michael/.rvm/gems/ruby-1.9.3-p551/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/home/michael/.rvm/gems/ruby-1.9.3-p551/bin/cap:23:in `load'
/home/michael/.rvm/gems/ruby-1.9.3-p551/bin/cap:23:in `<top (required)>'
-e:1:in `load'
-e:1:in `<main>'
Tasks: TOP => passenger:restart
The deploy has failed with an error: Exception while executing as user@host: undefined method `[]' for nil:NilClass
** Invoke deploy:failed (first_time)
** Execute deploy:failed

Environment on the host machine

Apache 2.4 + passenger 4.0.56

user@host:~> which passenger
/usr/local/rvm/gems/ruby-1.9.3-p551/bin/passenger
user@host:~> which ruby
/usr/local/rvm/rubies/ruby-1.9.3-p551/bin/ruby
user@host:~>passenger -v
Phusion Passenger version 4.0.56

"Phusion Passenger" is a trademark of Hongli Lai & Ninh Bui.

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    actionmailer (3.2.21)
      actionpack (= 3.2.21)
      mail (~> 2.5.4)
    actionpack (3.2.21)
      activemodel (= 3.2.21)
      activesupport (= 3.2.21)
      builder (~> 3.0.0)
      erubis (~> 2.7.0)
      journey (~> 1.0.4)
      rack (~> 1.4.5)
      rack-cache (~> 1.2)
      rack-test (~> 0.6.1)
      sprockets (~> 2.2.1)
    activemodel (3.2.21)
      activesupport (= 3.2.21)
      builder (~> 3.0.0)
    activerecord (3.2.21)
      activemodel (= 3.2.21)
      activesupport (= 3.2.21)
      arel (~> 3.0.2)
      tzinfo (~> 0.3.29)
    activeresource (3.2.21)
      activemodel (= 3.2.21)
      activesupport (= 3.2.21)
    activesupport (3.2.21)
      i18n (~> 0.6, >= 0.6.4)
      multi_json (~> 1.0)
    airbrake (4.1.0)
      builder
      multi_json
    annotate (2.6.5)
      activerecord (>= 2.3.0)
      rake (>= 0.8.7)
    ansi (1.4.3)
    arel (3.0.3)
    awesome_print (1.2.0)
    builder (3.0.4)
    capistrano (3.4.0)
      i18n
      rake (>= 10.0.0)
      sshkit (~> 1.3)
    capistrano-bundler (1.1.4)
      capistrano (~> 3.1)
      sshkit (~> 1.2)
    capistrano-passenger (0.0.5)
      capistrano (~> 3.0)
    capistrano-rails (1.1.3)
      capistrano (~> 3.1)
      capistrano-bundler (~> 1.1)
    capistrano-rvm (0.1.2)
      capistrano (~> 3.0)
      sshkit (~> 1.2)
    coffee-rails (3.2.2)
      coffee-script (>= 2.2.0)
      railties (~> 3.2.0)
    coffee-script (2.3.0)
      coffee-script-source
      execjs
    coffee-script-source (1.8.0)
    colorize (0.7.7)
    daemons (1.1.9)
    dbd-pg (0.3.9)
      dbi (>= 0.4.0)
      pg
    dbi (0.4.5)
      deprecated (= 2.0.1)
    delayed_job (4.0.4)
      activesupport (>= 3.0, < 4.2)
    delayed_job_active_record (4.0.2)
      activerecord (>= 3.0, < 4.2)
      delayed_job (>= 3.0, < 4.1)
    deprecated (2.0.1)
    erubis (2.7.0)
    execjs (2.2.2)
    hashie (3.3.1)
    hike (1.2.3)
    i18n (0.7.0)
    journey (1.0.4)
    jquery-rails (3.1.2)
      railties (>= 3.0, < 5.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (5.0.2)
      railties (>= 3.2.16)
    json (1.8.2)
    libv8 (3.16.14.7)
    mail (2.5.4)
      mime-types (~> 1.16)
      treetop (~> 1.4.8)
    mime-types (1.25.1)
    minitest (4.7.5)
    minitest-reporters (0.14.24)
      ansi
      builder
      minitest (>= 2.12, < 5.0)
      powerbar
    multi_json (1.10.1)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-ssh (2.9.2)
    netrc (0.8.0)
    pg (0.17.1)
    polyglot (0.3.5)
    powerbar (1.0.11)
      ansi (~> 1.4.0)
      hashie (>= 1.1.0)
    psych (2.0.6)
    rack (1.4.5)
    rack-cache (1.2)
      rack (>= 0.4)
    rack-ssl (1.3.4)
      rack
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (3.2.21)
      actionmailer (= 3.2.21)
      actionpack (= 3.2.21)
      activerecord (= 3.2.21)
      activeresource (= 3.2.21)
      activesupport (= 3.2.21)
      bundler (~> 1.0)
      railties (= 3.2.21)
    rails_autolink (1.1.6)
      rails (> 3.1)
    railties (3.2.21)
      actionpack (= 3.2.21)
      activesupport (= 3.2.21)
      rack-ssl (~> 1.3.2)
      rake (>= 0.8.7)
      rdoc (~> 3.4)
      thor (>= 0.14.6, < 2.0)
    rake (10.4.2)
    rcov (0.9.11)
    rdoc (3.12.2)
      json (~> 1.4)
    redcarpet (3.2.0)
    ref (1.0.5)
    rest-client (1.7.2)
      mime-types (>= 1.16, < 3.0)
      netrc (~> 0.7)
    sass (3.4.7)
    sass-rails (3.2.6)
      railties (~> 3.2.0)
      sass (>= 3.1.10)
      tilt (~> 1.3)
    snmp (1.2.0)
    sprockets (2.2.3)
      hike (~> 1.2)
      multi_json (~> 1.0)
      rack (~> 1.0)
      tilt (~> 1.1, != 1.3.0)
    sqlite3 (1.3.10)
    sshkit (1.7.1)
      colorize (>= 0.7.0)
      net-scp (>= 1.1.2)
      net-ssh (>= 2.8.0)
    therubyracer (0.12.1)
      libv8 (~> 3.16.14.0)
      ref
    thor (0.19.1)
    tilt (1.4.1)
    treetop (1.4.15)
      polyglot
      polyglot (>= 0.3.1)
    tzinfo (0.3.43)
    uglifier (2.5.3)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    webrick (1.3.1)

PLATFORMS
  ruby

DEPENDENCIES
  airbrake
  annotate (>= 2.6.0)
  awesome_print
  capistrano
  capistrano-bundler
  capistrano-passenger
  capistrano-rails
  capistrano-rvm
  coffee-rails (~> 3.2.1)
  daemons
  dbd-pg
  dbi
  delayed_job_active_record
  execjs
  jquery-rails
  jquery-ui-rails
  json
  minitest
  minitest-reporters (~> 0.14.24)
  pg
  psych
  rails (= 3.2.21)
  rails_autolink
  rcov (~> 0.9.1)
  redcarpet
  rest-client
  sass-rails (~> 3.2.3)
  snmp
  sqlite3
  therubyracer
  uglifier (~> 2.5.1)
  webrick (~> 1.3.1)

GemNotFoundException when passenger installed under different ruby

I'm trying to upgrade my ruby version from 2.3.1 to 2.6.3 and this is the error I'm getting:

 DEBUG [6a3bd9a7] Command: cd /home/deploy/project/releases/20191209192212 && ( export NODE_ENV="production" ; ~/.rvm/bin/rvm 2.3.1 do passenger -v )

 DEBUG [69be9b5c]       /home/deploy/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:271:in `find_spec_for_exe': can't find gem passenger (>= 0.a) (Gem::GemNotFoundException)

        from /home/deploy/.rvm/rubies/ruby-2.3.1/lib/ruby/site_ruby/2.3.0/rubygems.rb:299:in `activate_bin_path'

        from /home/deploy/.rvm/gems/ruby-2.3.1/bin/passenger:23:in `<main>'

        from /home/deploy/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `eval'

        from /home/deploy/.rvm/gems/ruby-2.3.1/bin/ruby_executable_hooks:15:in `<main>'

I'm able to replicate this just running ~/.rvm/bin/rvm 2.3.1 do passenger -v on the server in the release folder and was able to get it to work running ~/.rvm/bin/rvm 2.3.1 do ruby -S passenger -v but I don't see a way to modify the command to that

Deployment fails with ruby version 2.4.x

Full trace:

bundle exec cap production deploy:check --trace
** Invoke production (first_time)
** Execute production
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Invoke passenger:rvm:hook (first_time)
** Invoke passenger:test_which_passenger (first_time)
** Execute passenger:test_which_passenger
cap aborted!
NoMethodError: undefined method `>=' for nil:NilClass
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/formatters/pretty.rb:53:in `write_message'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/formatters/pretty.rb:21:in `log_command_start'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/netssh.rb:84:in `execute_command'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `block in create_command_and_execute'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `tap'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:137:in `create_command_and_execute'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:50:in `test'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/capistrano-passenger-0.2.0/lib/capistrano/tasks/passenger.cap:42:in `block (3 levels) in <top (required)>'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/backends/abstract.rb:29:in `run'
/Users/home/.rbenv/versions/2.4.5/lib/ruby/gems/2.4.0/gems/sshkit-1.9.0/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
Tasks: TOP => rvm:hook => passenger:rvm:hook => passenger:test_which_passenger

switching to ruby 2.3.x works for some reason

rake restart task fails to detect passenger version

... due to no-longer-valid regular expression capistrano-passenger-0.0.5/lib/capistrano/tasks/passenger.cap:8

passenger_version = capture(:passenger, '-v').match(/\APhusion Passenger version (.*)$/)[1].to_i

NOTE:

pry(#<SSHKit::Backend::Netssh>)> capture(:passenger, '-v')
=> "Phusion Passenger 5.0.27"

Where is "version" ... ? The output of passenger changed between 5.0.12 and 5.0.27 somewhere

cap staging passenger:restart not issuing command to restart?

I'm sure I've got something configured wrong (and I'm reading through all the Passenger 5 issues).
My Capfile:

require 'capistrano/setup'

require 'capistrano/deploy'

require 'capistrano/rvm'
require 'capistrano/rails'
require 'capistrano/passenger'

Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

config/deploy.rb:

lock '3.4.0'

set :application, 'app_name'
set :repo_url, "ssh://git@stash_url/#{fetch :application}.git"

set :deploy_to, "/usr/share/nginx/apps/#{fetch :application}"
set :user, 'deployer'
set :log_level, :debug

linked_files = %w(config/database.yml config/secrets.yml)
set :linked_files, fetch(:linked_files, []) + linked_files

linked_dirs = %w(log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system public/uploads)
set :linked_dirs, fetch(:linked_dirs, []) + linked_dirs

# Needed since we develop on windows machines with a different Gemfile.lock through jenkins
set :bundle_flags, '--quiet'

namespace :deploy do
  before :published, 'linked_files:upload'
  after :publishing, :restart
end

When I do bundle exec cap staging deploy:restart:

DEBUG [b43d59aa] Running /usr/bin/env [ -d ~/.rvm ] on vc2coma2044169n
DEBUG [b43d59aa] Command: [ -d ~/.rvm ]
DEBUG [b43d59aa] Finished in 0.452 seconds with exit status 1 (failed).
DEBUG [bca34c86] Running /usr/bin/env [ -d /usr/local/rvm ] on vc2coma2044169n
DEBUG [bca34c86] Command: [ -d /usr/local/rvm ]
DEBUG [bca34c86] Finished in 0.291 seconds with exit status 0 (successful).
DEBUG [ecbcd797] Running /usr/local/rvm/bin/rvm version on vc2coma2044169n
DEBUG [ecbcd797] Command: ( HTTP_PROXY=proxy HTTPS_PROXY=proxy /usr/local/rvm/bin/rvm version )
DEBUG [ecbcd797]        rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [ecbcd797] Finished in 0.892 seconds with exit status 0 (successful).
rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [d25272f2] Running /usr/local/rvm/bin/rvm current on vc2coma2044169n
DEBUG [d25272f2] Command: ( HTTP_PROXY=proxy HTTPS_PROXY=proxy /usr/local/rvm/bin/rvm current )
DEBUG [d25272f2]        ruby-2.2.1
DEBUG [d25272f2] Finished in 0.826 seconds with exit status 0 (successful).
ruby-2.2.1
DEBUG [5c1c9244] Running /usr/local/rvm/bin/rvm default do ruby --version on vc2coma2044169n
DEBUG [5c1c9244] Command: ( HTTP_PROXY=proxy HTTPS_PROXY=proxy /usr/local/rvm/bin/rvm default do ruby --version )
DEBUG [5c1c9244]        ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
DEBUG [5c1c9244] Finished in 1.191 seconds with exit status 0 (successful).
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]

Surely I'm got something set wrong, any ideas?
Thanks in advance!

Upgrade to 0.0.3 causes error with rvm:hook

My Capfile:

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rbenv'
require 'capistrano/rails'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }

After upgrading to 0.0.3, when I to do a cap production deploy I get:

(Backtrace restricted to imported tasks)
cap aborted!
Don't know how to build task 'rvm:hook'
/path/to/my/app/Capfile:8:in `<top (required)>'
LoadError: cannot load such file -- capistrano/passenger
/path/to/my/app/Capfile:8:in `<top (required)>'
(See full trace by running task with --trace)

no tty present and no askpass program specified

Hey,

I'm trying to use the new Passenger restart method (I used to use touch.txt).

I am using Ubuntu, RVM, Nginx + Passenger module.

When I go with the 100% vanilla setup of capistrano/passenger, I get this:

SSHKit::Runner::ExecuteError: Exception while executing as deploy@xxxxxxxxxx: passenger-config exit status: 1
passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: You are not authorized to query the status for this Phusion Passenger instance. Please try again with 'rvmsudo'.

I set this option: set :passenger_restart_with_sudo, true

And then I get this:

SSHKit::Runner::ExecuteError: Exception while executing as deploy@xxxxxxxxxx: sudo exit status: 1
sudo stdout: Nothing written
sudo stderr: sudo: no tty present and no askpass program specified

Is there anything I can do without messing with the sudoers file? I have a lot of servers and don't really have the energy right now to change all that, if possible.

Capfile:

require 'capistrano/setup'
require 'capistrano/deploy'

require 'rvm/capistrano'

require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'
require 'capistrano/sitemap_generator'

require 'whenever/capistrano'
require 'airbrake/capistrano3'

# Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
Dir.glob('lib/capistrano/tasks/*.rake').each {|r| import r}

deploy.rb

lock '3.2.1'

set :application, 'XXXXXXXXX'
set :repo_url,    '[email protected]:XXXXXXXXXX/XXXXXXXXX.git'

set :rvm_type, :system
set :rvm_path, '/usr/local/lib/rvm'

set :passenger_restart_with_sudo, true

set :whenever_identifier, ->{ "#{fetch(:application)}_#{fetch(:stage)}" }
set :whenever_roles, [:app, :primary_production_worker]

set :linked_files, %w{config/database.local.yml config/secrets.local.yml}
set :linked_dirs, %w{log}

after 'deploy:published', 'foreman:export'
after 'deploy:published', 'foreman:restart'
after 'deploy:finished',  'airbrake:deploy'

Passing some envirionmental variables doesn't work with sudo

Settings:

set :passenger_environment_variables, {
  path: '/usr/share/gems/gems/passenger-4.0.56/bin:$PATH',
  passenger_tmpdir: '/var/www/apps/tmp'
}
set :passenger_restart_with_sudo, true

Generate this command:
cd /var/www/apps/app_name/current && ( PATH=/usr/share/gems/gems/passenger-4.0.56/bin:$PATH PASSENGER_TMPDIR=/var/www/apps/tmp /usr/bin/env sudo /usr/bin/env passenger-config restart-app /var/www/apps/app_name --ignore-app-not-running )

When running it I get:
*** ERROR: Phusion Passenger doesn't seem to be running.

What works for me is to move sudo in front of the variables or doing sudo -i. This works for example:
cd /var/www/apps/app_name/current && ( sudo /usr/bin/env PATH=/usr/share/gems/gems/passenger-4.0.56/bin:$PATH PASSENGER_TMPDIR=/var/www/apps/tmp passenger-config restart-app /var/www/apps/app_name --ignore-app-not-running )

As a work-around I'm setting the restart command to:
set :passenger_restart_command, 'PASSENGER_TMPDIR=/var/www/apps/tmp passenger-config restart-app'

Unsure how to disable turbocaching during restart

Hey folks, I'm having trouble ensuring that turbocaching is disabled when I deploy. My initial thought was to add the --disable-turbocaching flag within the passenger_restart_options in my deploy.rb file like this:

set :passenger_in_gemfile, true
set :passenger_restart_options, -> { "#{deploy_to} --ignore-app-not-running --disable-turbocaching" }

but had no luck as the passenger-config restart-app command does not accept --disable-turbocaching as an option:

passenger-config stdout: Nothing written
passenger-config stderr: *** ERROR: invalid option: --disable-turbocaching
Usage 1: passenger-config restart-app <APP PATH PREFIX> [OPTIONS]
Usage 2: passenger-config restart-app --name <APP GROUP NAME> [OPTIONS]

  Restart an application. The syntax determines how the application that is to
  be restarted, will be selected.

  1. Selects all applications whose paths begin with the given prefix.

     Example: passenger-config restart-app /webapps
     Restarts all apps whose path begin with /webapps, such as /webapps/foo,
     /webapps/bar and /webapps123.

  2. Selects a specific application based on an exact match of its app group
     name.

     Example: passenger-config restart-app --name /webapps/foo
     Restarts only /webapps/foo, but not for example /webapps/foo/bar or
     /webapps/foo123.

Options:
        --name APP_GROUP_NAME        The app group name to select
        --rolling-restart            Perform a rolling restart instead of a
                                     regular restart (Enterprise only). The
                                     default is a blocking restart
        --ignore-app-not-running     Exit successfully if the specified
                                     application is not currently running. The
                                     default is to exit with an error
        --instance NAME              The Phusion Passenger instance to select
    -h, --help                       Show this help

I'm running the latest version of Passenger as a standalone server that installs from my Gemfile. Any help here would be awesome, thanks!

undefined method `[]' for nil:NilClass after upgraging Passenger to 5.0.22

I received an email from Phusion Passenger team notifying us that a medium severity security vulnerability has been found in Passenger and they recommend to upgrade Passenger to 5.0.22 ASAP.

After I upgraded Passenger to 5.0.22, I couldn't restart Passenger via Capistrano. It keeps getting this error:

SSHKit::Runner::ExecuteError: Exception while executing as deploy@**.**.**.**: undefined method `[]' for nil:NilClass

NoMethodError: undefined method `[]' for nil:NilClass

I don't know.. Is it Passenger or Capistrano issue?

For full tracing:

$ cap staging passenger:restart --trace
** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke rvm:hook (first_time)
** Invoke passenger:rvm:hook (first_time)
** Invoke passenger:test_which_passenger (first_time)
** Execute passenger:test_which_passenger
DEBUG [669d21f4] Running /usr/bin/env which passenger as deploy@**.**.**.**
DEBUG [669d21f4] Command: /usr/bin/env which passenger
DEBUG [669d21f4]    /usr/bin/passenger
DEBUG [669d21f4] Finished in 1.268 seconds with exit status 0 (successful).
** Execute passenger:rvm:hook
** Execute rvm:hook
DEBUG [ae5fa7bb] Running /usr/bin/env [ -d ~/.rvm ] as deploy@**.**.**.**
DEBUG [ae5fa7bb] Command: [ -d ~/.rvm ]
DEBUG [ae5fa7bb] Finished in 0.214 seconds with exit status 1 (failed).
DEBUG [7bcc35da] Running /usr/bin/env [ -d /usr/local/rvm ] as deploy@**.**.**.**
DEBUG [7bcc35da] Command: [ -d /usr/local/rvm ]
DEBUG [7bcc35da] Finished in 0.138 seconds with exit status 0 (successful).
** Invoke rvm:check (first_time)
** Execute rvm:check
DEBUG [947bf3dc] Running /usr/local/rvm/bin/rvm version as deploy@**.**.**.**
DEBUG [947bf3dc] Command: /usr/local/rvm/bin/rvm version
DEBUG [947bf3dc]    rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [947bf3dc]
DEBUG [947bf3dc] Finished in 0.299 seconds with exit status 0 (successful).
rvm 1.26.11 (latest) by Wayne E. Seguin <[email protected]>, Michal Papis <[email protected]> [https://rvm.io/]
DEBUG [c8711a73] Running /usr/local/rvm/bin/rvm current as deploy@**.**.**.**
DEBUG [c8711a73] Command: /usr/local/rvm/bin/rvm current
DEBUG [c8711a73]    ruby-2.2.1
DEBUG [c8711a73]
DEBUG [c8711a73] Finished in 0.293 seconds with exit status 0 (successful).
ruby-2.2.1
DEBUG [a1a529c1] Running /usr/local/rvm/bin/rvm 2.2.1 do ruby --version as deploy@**.**.**.**
DEBUG [a1a529c1] Command: /usr/local/rvm/bin/rvm 2.2.1 do ruby --version
DEBUG [a1a529c1]    ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
DEBUG [a1a529c1]
DEBUG [a1a529c1] Finished in 0.457 seconds with exit status 0 (successful).
ruby 2.2.1p85 (2015-02-26 revision 49769) [x86_64-linux]
** Invoke bundler:map_bins (first_time)
** Invoke passenger:bundler:hook (first_time)
** Execute passenger:bundler:hook
** Execute bundler:map_bins
** Invoke deploy:set_rails_env (first_time)
** Execute deploy:set_rails_env
** Invoke deploy:set_linked_dirs (first_time)
** Execute deploy:set_linked_dirs
** Invoke passenger:restart (first_time)
** Execute passenger:restart
DEBUG [b7882bc4] Running /usr/bin/env if test ! -d /var/www/project/current; then echo "Directory does not exist '/var/www/project/current'" 1>&2; false; fi as deploy@**.**.**.**
DEBUG [b7882bc4] Command: if test ! -d /var/www/project/current; then echo "Directory does not exist '/var/www/project/current'" 1>&2; false; fi
DEBUG [b7882bc4] Finished in 0.135 seconds with exit status 0 (successful).
DEBUG [0007c29a] Running /usr/bin/env passenger -v as deploy@**.**.**.**
DEBUG [0007c29a] Command: cd /var/www/project/current && /usr/bin/env passenger -v
DEBUG [0007c29a]    Phusion Passenger 5.0.22
DEBUG [0007c29a]
DEBUG [0007c29a] Finished in 0.176 seconds with exit status 0 (successful).
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@**.**.**.**: undefined method `[]' for nil:NilClass
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:24:in `rescue in run_backend'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:21:in `run_backend'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:16:in `execute'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/coordinator.rb:21:in `each'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:55:in `on'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-passenger-0.1.1/lib/capistrano/tasks/passenger.cap:11:in `block (2 levels) in <top (required)>'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.1/bin/cap:23:in `load'
/Users/username/.rvm/gems/ruby-2.2.1/bin/cap:23:in `<main>'
/Users/username/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/Users/username/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
NoMethodError: undefined method `[]' for nil:NilClass
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-passenger-0.1.1/lib/capistrano/tasks/passenger.cap:15:in `block (5 levels) in <top (required)>'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:77:in `within'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-passenger-0.1.1/lib/capistrano/tasks/passenger.cap:13:in `block (4 levels) in <top (required)>'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/abstract.rb:85:in `with'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-passenger-0.1.1/lib/capistrano/tasks/passenger.cap:12:in `block (3 levels) in <top (required)>'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `instance_exec'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/backends/netssh.rb:54:in `run'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:21:in `run_backend'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/runners/sequential.rb:16:in `execute'
/Users/username/.rvm/gems/ruby-2.2.1/gems/sshkit-1.7.1/lib/sshkit/coordinator.rb:21:in `each'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-3.4.0/lib/capistrano/dsl.rb:55:in `on'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-passenger-0.1.1/lib/capistrano/tasks/passenger.cap:11:in `block (2 levels) in <top (required)>'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `call'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:240:in `block in execute'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `each'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:235:in `execute'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:179:in `block in invoke_with_call_chain'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/monitor.rb:211:in `mon_synchronize'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:172:in `invoke_with_call_chain'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/task.rb:165:in `invoke'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:150:in `invoke_task'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block (2 levels) in top_level'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `each'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:106:in `block in top_level'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:115:in `run_with_threads'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:100:in `top_level'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:78:in `block in run'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:176:in `standard_exception_handling'
/Users/username/.rvm/rubies/ruby-2.2.1/lib/ruby/2.2.0/rake/application.rb:75:in `run'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-3.4.0/lib/capistrano/application.rb:15:in `run'
/Users/username/.rvm/gems/ruby-2.2.1/gems/capistrano-3.4.0/bin/cap:3:in `<top (required)>'
/Users/username/.rvm/gems/ruby-2.2.1/bin/cap:23:in `load'
/Users/username/.rvm/gems/ruby-2.2.1/bin/cap:23:in `<main>'
/Users/username/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `eval'
/Users/username/.rvm/gems/ruby-2.2.1/bin/ruby_executable_hooks:15:in `<main>'
Tasks: TOP => passenger:restart

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.