Capistrano Bundler在部署时出错

RMc*_*irn 1 capistrano ruby-on-rails bundler

我正在尝试使用capistrano来部署和捆绑我的rails应用程序.当我运行cap部署 - 或者更具体地说

bundle exec cap staging bundler:install --trace
Run Code Online (Sandbox Code Playgroud)

我似乎对以下堆栈跟踪有永久性错误.

** Invoke staging (first_time)
** Execute staging
** Invoke load:defaults (first_time)
** Execute load:defaults
** Invoke bundler:map_bins (first_time)
** Execute bundler:map_bins
** Invoke bundler:install (first_time)
** Execute bundler:install
DEBUG [bd567504] Running /usr/bin/env if test ! -d /var/www/TMC/current; then echo "Directory does not exist '/var/www/TMC/current'" 1>&2; false; fi on 162.243.225.14
DEBUG [bd567504] Command: if test ! -d /var/www/TMC/current; then echo "Directory does not exist '/var/www/TMC/current'" 1>&2; false; fi
DEBUG [bd567504] Finished in 1.443 seconds with exit status 0 (successful).
 INFO [2058712b] Running /usr/bin/env bundle install --binstubs /var/www/TMC/shared/bin --path /var/www/TMC/shared/bundle --without development test --deployment --quiet on 162.243.225.14
DEBUG [2058712b] Command: cd /var/www/TMC/current && /usr/bin/env bundle install --binstubs /var/www/TMC/shared/bin --path /var/www/TMC/shared/bundle --without development test --deployment --quiet
DEBUG [2058712b]    /usr/bin/env: bundle: No such file or directory
cap aborted!
SSHKit::Command::Failed: bundle exit status: 127
bundle stdout: Nothing written
bundle stderr: /usr/bin/env: bundle: No such file or directory
/Library/Ruby/Gems/2.0.0/gems/sshkit-1.4.0/lib/sshkit/command.rb:98:in `exit_status='
Run Code Online (Sandbox Code Playgroud)

我用厨师配置机器并设置RBENV等所以我不使用capistrano/rbenv.我的gemfile的相关部分是:

group :development do
      gem 'capistrano-rails', '~> 1.0.0'
      gem 'capistrano-bundler', '~> 1.1.2'
end
Run Code Online (Sandbox Code Playgroud)

我必须登录并在/ var/www/TMC/current路径中手动创建当前目录.

任何想法,将不胜感激.

Shi*_*pai 5

你确定你为当前的rvm安装了服务器上的gem Bundler吗?看起来您的服务器上没有安装bundle.首先尝试安装bundler:

sudo apt-get install bundler
Run Code Online (Sandbox Code Playgroud)