NoMethodError:未定义的方法`spec'为零:NilClass

时间:2018-01-23 14:08:41

标签: ruby-on-rails ruby bundler continuous-deployment

突然我在登台服务器(EngineYard)上部署期间跟踪了gem后面临这个错误。我们使用厨师食谱进行部署。

错误日志

NoMethodError: undefined method `spec' for nil:NilClass
Did you mean?  inspect
An error occurred while installing ecwid_api (0.2.2), and Bundler cannot
continue.
Make sure that `gem install ecwid_api -v '0.2.2'` succeeds before bundling.
from /home/ey/.rvm/rubies/ruby-2.2.3/lib/ruby/gems/2.2.0/gems/engineyard-serverside-2.6.14/lib/engineyard-serverside/servers.rb:85:in `run_on_each!'

Gemfile.lock - 看起来有问题的部分

GIT
  remote: https://github.com/ParthivPatel-BTC/ecwid_api.git
  revision: 079b697157356612b993e42f1e71269024b7c376
  specs:
    ecwid_api (0.2.2)
      faraday (= 0.12.2)
      faraday_middleware (= 0.10.1)

知道如何解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

问题在于bunlder版本

+ 12s $ ssh -i /home/deploy/.ssh/internal -o StrictHostKeyChecking=no -o UserKnownHostsFile=/tmp/ey-ss-known-hosts20180123-28710-1k6s7ez -o PasswordAuthentication=no -o ServerAliveInterval=60 deploy@ec2-54-242-111-22.compute-1.amazonaws.com 'sh -l -c '\''export GIT_SSH="/data/feed_champion/shared/config/feed_champion-ssh-wrapper" && export LANG="en_US.UTF-8" && unset RUBYOPT BUNDLE_PATH BUNDLE_FROZEN BUNDLE_WITHOUT BUNDLE_BIN BUNDLE_GEMFILE && cd /data/feed_champion/releases/20180123225204 && ruby -S bundle _1.7.9_ install --gemfile /data/feed_champion/releases/20180123225204/Gemfile --path /data/feed_champion/shared/bundled_gems --binstubs /data/feed_champion/releases/20180123225204/ey_bundler_binstubs --deployment --without test development'\'

Gemfile.lock具有bundler (>= 1.3.0)作为rails依赖项的一部分。

我所做的一切都是明确添加了bundler gem和最新版本1.16.1