Capistrano 3 + rbenv = DEBUG [deacda0f] rbenv: passenger: command not found

Capistrano 3 + rbenv = DEBUG [deacda0f] rbenv: passenger: command not found

我是第一次尝试 Capistrano 3 和 rbenv,正在部署应用程序,但出现错误:rbenv: passenger: command not found - 这是最后几行:

 INFO [e5878213] Finished in 3.638 seconds with exit status 0 (successful).
 INFO [5c8cffef] Running /usr/bin/env rm -rf /home/deploy/skilltry/current on 198.199.100.198
DEBUG [5c8cffef] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.0 /usr/bin/env rm -rf /home/deploy/skilltry/current )
 INFO [5c8cffef] Finished in 0.154 seconds with exit status 0 (successful).
 INFO [07393ffe] Running /usr/bin/env ln -s /home/deploy/skilltry/releases/20150413202630 /home/deploy/skilltry/current on 198.199.100.198
DEBUG [07393ffe] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.0 /usr/bin/env ln -s /home/deploy/skilltry/releases/20150413202630 /home/deploy/skilltry/current )
 INFO [07393ffe] Finished in 0.092 seconds with exit status 0 (successful).
DEBUG [deacda0f] Running RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.0 ~/.rbenv/bin/rbenv exec passenger -v on 198.199.100.198
DEBUG [deacda0f] Command: ( RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.0 RBENV_ROOT=~/.rbenv RBENV_VERSION=2.2.0 ~/.rbenv/bin/rbenv exec passenger -v )
DEBUG [deacda0f]    rbenv: passenger: command not found

这是我的部署文件:

set :scm, :git
set :branch, 'master'
set :keep_releases, 5
set :format, :pretty
set :log_level, :debug
set :pty, true
set :user, 'deploy'
set :passenger_restart_with_sudo, false
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

set :rbenv_type, :user
set :rbenv_ruby, '2.2.0'
set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
set :rbenv_map_bins, %w{rake gem bundle ruby rails}


namespace :deploy do

  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      execute :touch, release_path.join('tmp/restart.txt')
    end
  end

  after :publishing, 'deploy:restart'
  after :finishing, 'deploy:cleanup'
end

将 passenger 添加到您的 Gemfile

gem 'passenger'