Dan*_*bio 9 ruby capistrano ruby-on-rails
这个问题已经在stackoverflow和其他论坛上被问了几次,但我似乎无法通过我得到的这个错误.当我运行时capistrano production deploy,我将此错误作为部署过程的一部分.
cap production bundler:install
00:00 bundler:install
      01 bundle install --path /var/local/blackduck_flock_rails/shared/bundle --without development test --deployme…
      01 An error occurred while installing json (1.8.6), and Bundler cannot continue.
      01 Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
(Backtrace restricted to imported tasks)
cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as serv-deployer@oh-utility01.dc1.lan: bundle exit status: 5
bundle stdout: An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
bundle stderr: Nothing written
Tasks: TOP => bundler:install
(See full trace by running task with --trace)
我看了一下我的log/capistrano.log档案,这里是我正在寻找麻烦拍摄的相关内容.
# Logfile created on 2017-05-03 14:42:16 -0400 by logger.rb/54072
INFO ---------------------------------------------------------------------------
  INFO START 2017-05-03 14:42:16 -0400 cap production bundler:install
  INFO ---------------------------------------------------------------------------
 DEBUG [ec1d281e] Running if test ! -d /var/local/blackduck_flock_rails/current; then echo "Directory does not exist '/var/local/blackduck_flock_rails/current'" 1>&2; false; fi as serv-deployer@oh-utility01.dc1.lan
 DEBUG [ec1d281e] Command: if test ! -d /var/local/blackduck_flock_rails/current; then echo "Directory does not exist '/var/local/blackduck_flock_rails/current'" 1>&2; false; fi
 DEBUG [ec1d281e] Finished in 0.328 seconds with exit status 0 (successful).
 DEBUG [4f633904] Running /usr/bin/env bundle check --path /var/local/blackduck_flock_rails/shared/bundle as serv-deployer@oh-utility01.dc1.lan
 DEBUG [4f633904] Command: cd /var/local/blackduck_flock_rails/current && /usr/bin/env bundle check --path /var/local/blackduck_flock_rails/shared/bundle
 DEBUG [4f633904]   Warning: the running version of Bundler is older than the version that created the lockfile. We suggest you upgrade to the latest version of Bundler by running `gem install bundler`.
 DEBUG [4f633904]   The following gems are missing
 * json (1.8.6)
 * tzinfo (1.2.2)
 * activesupport (4.2.6)
 etc. etc..........
 DEBUG [4f633904]    * uglifier (3.0.4)
DEBUG [4f633904]    Install missing gems with `bundle install`
 DEBUG [4f633904] Finished in 0.179 seconds with exit status 1 (failed).
  INFO [6c99e662] Running /usr/bin/env bundle install --path /var/local/blackduck_flock_rails/shared/bundle --without development test --deployment --quiet as serv-deployer@oh-utility01.dc1.lan
 DEBUG [6c99e662] Command: cd /var/local/blackduck_flock_rails/current && /usr/bin/env bundle install --path /var/local/blackduck_flock_rails/shared/bundle --without development test --deployment --quiet
 DEBUG [6c99e662]   An error occurred while installing json (1.8.6), and Bundler cannot continue.
Make sure that `gem install json -v '1.8.6'` succeeds before bundling.
所以首先要注意的是.日志告诉我,捆绑包的运行版本已过时,我应该安装最新的版本.这是我不明白的.在我的开发机器上,我有Bundler version 1.14.6.在我尝试部署到的目标服务器上,我也有Bundler version 1.14.6.我已经在两台机器上确认了它们,它们确实是一样的.其次,我对开发机器和目标机器都有相同的ruby版本.红宝石版本是2.2.5.
其次,当我gem list在目标服务器上运行时,我可以看到它json 1.8.6已安装.
json (1.8.3, 1.8.1)
是什么赋予了?
最后,问题必须出在目标机器上的这个目录中/var/local/blackduck_flock_rails/shared/bundle.在bundle目录中,我有一个ruby包含1.9.1和的文件夹2.2.0.这可能是问题的根源.我对这个问题感到困惑,似乎这些问题总是与某人机器上的某些特定内容相关,而这些内容并不一定适用.非常感谢帮助.
最可能的原因是您缺少一些 capistrano 无法安装的系统依赖项。
SSH 连接到您的服务器并尝试安装sudo apt-get install libgmp3-dev
如果它不能解决问题,请再次 ssh 并按照gem install json -v '1.8.6'它告诉您的方式运行并在此处发布您从中收到的错误消息。
| 归档时间: | 
 | 
| 查看次数: | 343 次 | 
| 最近记录: |