Ruby on Rails,通过Capistrano部署设置错误

时间:2015-08-18 12:27:05

标签: ruby ruby-on-rails-4 deployment capistrano3 rvm-capistrano

我是第一次在铁轨项目中设置Capistrano。当我运行“cap production deploy:check”时,它就可以了。但是当我运行“cap prodution deploy”时,它会回复以下错误......

(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deploy@mysite.com: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory

SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory

Tasks: TOP => deploy:updated => bundler:install
(See full trace by running task with --trace)
The deploy has failed with an error: Exception while executing as deploy@mysite.com: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory

我正在使用rails 4.2.3。 Ruby 2.2.2(带RVM)。我在Gemfile上为capistrano添加了以下宝石...

gem 'capistrano', '~> 3.4.0'
gem 'capistrano-rvm', '~> 0.1.2'
gem 'capistrano-bundler', '~> 1.1.4'
gem 'capistrano-rails', '~> 1.1.3'
gem 'capistrano3-unicorn', '~> 0.2.1'

1 个答案:

答案 0 :(得分:1)

您没有在服务器上安装bundler gem。看起来像这样的行表示:

bundle stderr: /usr/bin/env: bundle: No such file or directory

你需要在服务器上安装bundler gem,以便capistrano能够做到这一点。