Puma不会通过capistrano开始

时间:2016-11-23 22:30:42

标签: ruby-on-rails capistrano bundler capistrano3 puma

Puma在尝试使用capistrano安装时始终失败,但是当我尝试使用capistrano在当前目录中使用的相同命令时,puma启动成功。

bundle exec puma -C /home/deploy/apps/petfriend/shared/puma.rb --daemon

以下是

的描述
 bundle exec cap production puma:start --trace
    ** Invoke production (first_time)
    ** Execute production
    ** Invoke load:defaults (first_time)
    ** Execute load:defaults
    ** Invoke bundler:map_bins (first_time)
    ** 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 deploy:set_rails_env
    ** Invoke rbenv:validate (first_time)
    ** Execute rbenv:validate
    ** Invoke rbenv:map_bins (first_time)
    ** Execute rbenv:map_bins
    ** Invoke puma:start (first_time)
    ** Invoke puma:make_dirs (first_time)
    ** Execute puma:make_dirs
    00:00 puma:make_dirs
          01 mkdir /home/deploy/apps/petfriend/shared/tmp/sockets -p
        ✔ 01 deploy@ 1.153s
          02 mkdir /home/deploy/apps/petfriend/shared/tmp/pids -p
        ✔ 02 deploy@ 0.192s
    ** Execute puma:start
    00:01 puma:start
          using conf file /home/deploy/apps/petfriend/shared/puma.rb
          01 bundle exec puma -C /home/deploy/apps/petfriend/shared/puma.rb --daemon
          01 bash: bundle: command not found
          01
    cap aborted!
    SSHKit::Runner::ExecuteError: Exception while executing on host : puma exit status: 127
    puma stdout: bash: bundle: command not found
    puma stderr: Nothing written
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:15:in `rescue in block (2 levels) in execute'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:11:in `block (2 levels) in execute'
    SSHKit::Command::Failed: puma exit status: 127
    puma stdout: bash: bundle: command not found
    puma stderr: Nothing written
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/command.rb:100:in `exit_status='
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/netssh.rb:148:in `execute_command'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `block in create_command_and_execute'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `tap'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:141:in `create_command_and_execute'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:74:in `execute'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/capistrano-puma-e18b30c18ace/lib/capistrano/tasks/puma.rake:57:in `block (6 levels) in <top (required)>'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:93:in `with'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/capistrano-puma-e18b30c18ace/lib/capistrano/tasks/puma.rake:56:in `block (5 levels) in <top (required)>'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:85:in `within'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/capistrano-puma-e18b30c18ace/lib/capistrano/tasks/puma.rake:55:in `block (4 levels) in <top (required)>'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/capistrano-puma-e18b30c18ace/lib/capistrano/tasks/puma.rake:134:in `puma_switch_user'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/bundler/gems/capistrano-puma-e18b30c18ace/lib/capistrano/tasks/puma.rake:49:in `block (3 levels) in <top (required)>'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `instance_exec'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/backends/abstract.rb:29:in `run'
    /Users/pitops/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/sshkit-1.11.4/lib/sshkit/runners/parallel.rb:12:in `block (2 levels) in execute'
    Tasks: TOP => puma:start

任何线索?

2 个答案:

答案 0 :(得分:1)

我认为是因为

  

01 bash:bundle:command not found

问题在于捆绑,而不是puma

请尝试:

gem install bundler

在您应用的目录

答案 1 :(得分:0)

尝试在服务器上的文件~/.bashrc底部添加这些行:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
export PATH="$HOME/.rbenv/plugins/ruby-build/bin:$PATH"