0

我的 Gemfile.lock 使用命令 'cap production deploy' 出现了一些错误。我该如何解决?

终端:

cap aborted!
SSHKit::Runner::ExecuteError: Exception while executing as deployer@34.63.11.212: bundle exit status: 20
bundle stdout: Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES
section: 'activejob'
bundle stderr: Nothing written

宝石文件:

来源“ https://rubygems.org

gem 'rails', '4.2.6'
gem 'pg', '0.18.4'
gem 'sass-rails'
gem 'bootstrap-sass'
gem 'mailboxer'
gem 'es5-shim-rails'
gem "font-awesome-rails"
gem 'carrierwave'
gem 'file_validators'
gem 'country_select'
gem 'html5shiv-rails'
gem "respond-rails", "~> 1.0"
gem 'rails_admin'
gem 'mail_form', '~> 1.5.0.rc'
gem 'simple_form', '~> 3.0.0.rc'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'
gem 'omniauth'
gem 'omniauth-facebook'
gem 'jquery-rails'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0',          group: :doc

gem 'bcrypt', '~> 3.1.7'

group :test do
  gem 'selenium-webdriver', '2.35.1'
  gem 'capybara', '2.1.0'
  gem 'factory_girl_rails', '4.2.0'
  gem 'cucumber-rails', '1.4.0', :require => false
end

gem 'devise'
gem 'tzinfo-data', platforms: [:mingw, :mswin]
gem 'will_paginate', '~> 3.1'
gem "dynamic_sitemaps"
group :development do
  gem 'capistrano', '3.5.0'
  gem 'capistrano-rvm'
  gem 'capistrano-nginx'
  gem 'capistrano3-puma'
  gem 'capistrano-rails'
  gem 'capistrano-rails-db'
  gem 'capistrano-rails-console'
  gem 'capistrano-upload-config'
  gem 'sshkit-sudo'
end

宝石文件锁:

  specs:
    actionmailer (4.2.6)
      actionpack (= 4.2.6)
      actionview (= 4.2.6)
      activejob (= 4.2.6)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.6)
      actionview (= 4.2.6)
      activesupport (= 4.2.6)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    actionview (4.2.6)
      activesupport (= 4.2.6)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.2)
    activejob (4.2.6)
      activesupport (= 4.2.6)
      globalid (>= 0.3.0)
    activemodel (4.2.6)
      activesupport (= 4.2.6)
      builder (~> 3.1)
    activerecord (4.2.6)
      activemodel (= 4.2.6)
      activesupport (= 4.2.6)
      arel (~> 6.0)
    activesupport (4.2.6)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    airbrussh (1.0.2)
      sshkit (>= 1.6.1, != 1.7.0)
    arel (6.0.3)
    autoprefixer-rails (6.3.6.2)
      execjs
    bcrypt (3.1.11)
    bootstrap-sass (3.3.6)
      autoprefixer-rails (>= 5.2.1)
      sass (>= 3.3.4)
    builder (3.2.2)
    capistrano (3.5.0)
      airbrussh (>= 1.0.0)
      capistrano-harrow
      i18n
      rake (>= 10.0.0)
      sshkit (>= 1.9.0)
    capistrano-bundler (1.1.4)
      capistrano (~> 3.1)
      sshkit (~> 1.2)
    capistrano-harrow (0.5.2)
    capistrano-nginx (1.0.0)
      capistrano (~> 3.1)
    capistrano-rails (1.1.7)
      capistrano (~> 3.1)
      capistrano-bundler (~> 1.1)
    capistrano-rails-console (1.0.2)
      capistrano (>= 3.1.0, < 4.0.0)
    capistrano-rails-db (0.0.2)
      capistrano-rails (~> 1.1)
    capistrano-rvm (0.1.2)
      capistrano (~> 3.0)
      sshkit (~> 1.2)
    capistrano-upload-config (0.7.0)
      capistrano (>= 3.0)
    capistrano3-puma (1.2.1)
      capistrano (~> 3.0)
      puma (>= 2.6)
    capybara (2.1.0)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    carrierwave (0.11.2)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
      mimemagic (>= 0.3.0)
    childprocess (0.5.9)
      ffi (~> 1.0, >= 1.0.11)
    coffee-rails (4.0.1)
      coffee-script (>= 2.2.0)
      railties (>= 4.0.0, < 5.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    concurrent-ruby (1.0.2)
    countries (1.2.5)
      currencies (~> 0.4.2)
      i18n_data (~> 0.7.0)
    country_select (2.5.2)
      countries (~> 1.2.0)
      sort_alphabetical (~> 1.0)
    cucumber (2.4.0)
      builder (>= 2.1.2)
      cucumber-core (~> 1.5.0)
      cucumber-wire (~> 0.0.1)
      diff-lcs (>= 1.1.3)
      gherkin (~> 4.0)
      multi_json (>= 1.7.5, < 2.0)
      multi_test (>= 0.1.2)
    cucumber-core (1.5.0)
      gherkin (~> 4.0)
    cucumber-rails (1.4.0)
      capybara (>= 1.1.2)
      cucumber (>= 1.2.0)
      nokogiri (>= 1.5.0)
      rails (>= 3.0.0)
    cucumber-wire (0.0.1)
    currencies (0.4.2)
    devise (4.1.1)
      bcrypt (~> 3.0)
      orm_adapter (~> 0.1)
      railties (>= 4.1.0, < 5.1)
      responders
      warden (~> 1.2.3)
    diff-lcs (1.2.5)
    dynamic_sitemaps (2.0.0)
    erubis (2.7.0)
    es5-shim-rails (4.0.1)
      actionpack (>= 3.1)
      railties (>= 3.1)
    execjs (2.7.0)
    factory_girl (4.2.0)
      activesupport (>= 3.0.0)
    factory_girl_rails (4.2.0)
      factory_girl (~> 4.2.0)
      railties (>= 3.0.0)
    faraday (0.9.2)
      multipart-post (>= 1.2, < 3)
    ffi (1.9.10)
    file_validators (2.1.0)
      activemodel (>= 3.0)
      mime-types (>= 1.0)
    font-awesome-rails (4.6.3.1)
      railties (>= 3.2, < 5.1)
    foreigner (1.7.4)
      activerecord (>= 3.0.0)
    gherkin (4.0.0)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    haml (4.0.7)
      tilt
    hashie (3.4.4)
    html5shiv-rails (0.0.2)
      railties (>= 3.2.0, < 5.0)
    i18n (0.7.0)
    i18n_data (0.7.0)
    jbuilder (2.5.0)
      activesupport (>= 3.0.0, < 5.1)
      multi_json (~> 1.2)
    jquery-rails (4.1.1)
      rails-dom-testing (>= 1, < 3)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    jquery-ui-rails (5.0.5)
      railties (>= 3.2.16)
    json (1.8.3)
    jwt (1.5.1)
    kaminari (0.17.0)
      actionpack (>= 3.0.0)
      activesupport (>= 3.0.0)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.4)
      mime-types (>= 1.16, < 4)
    mail_form (1.5.1)
      actionmailer (>= 3.2, < 5)
      activemodel (>= 3.2, < 5)
    mailboxer (0.13.0)
      carrierwave (>= 0.5.8)
      foreigner (>= 0.9.1)
      rails (>= 3.2.0)
    mime-types (3.1)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2016.0521)
    mimemagic (0.3.1)
    mini_portile2 (2.1.0)
    minitest (5.9.0)
    multi_json (1.12.1)
    multi_test (0.1.2)
    multi_xml (0.5.5)
    multipart-post (2.0.0)
    nested_form (0.3.2)
    net-scp (1.2.1)
      net-ssh (>= 2.6.5)
    net-ssh (3.2.0)
    nokogiri (1.6.8)
      mini_portile2 (~> 2.1.0)
      pkg-config (~> 1.1.7)
    oauth2 (1.1.0)
      faraday (>= 0.8, < 0.10)
      jwt (~> 1.0, < 1.5.2)
      multi_json (~> 1.3)
      multi_xml (~> 0.5)
      rack (>= 1.2, < 3)
    omniauth (1.3.1)
      hashie (>= 1.2, < 4)
      rack (>= 1.0, < 3)
    omniauth-facebook (3.0.0)
      omniauth-oauth2 (~> 1.2)
    omniauth-oauth2 (1.4.0)
      oauth2 (~> 1.0)
      omniauth (~> 1.2)
    orm_adapter (0.5.0)
    pg (0.15.1)
    pkg-config (1.1.7)
    puma (3.4.0)
    rack (1.6.4)
    rack-pjax (0.8.0)
      nokogiri (~> 1.5)
      rack (~> 1.1)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.6)
      actionmailer (= 4.2.6)
      actionpack (= 4.2.6)
      actionview (= 4.2.6)
      activejob (= 4.2.6)
      activemodel (= 4.2.6)
      activerecord (= 4.2.6)
      activesupport (= 4.2.6)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.6)
      sprockets-rails
    rails-deprecated_sanitizer (1.0.3)
      activesupport (>= 4.2.0.alpha)
    rails-dom-testing (1.0.7)
      activesupport (>= 4.2.0.beta, < 5.0)
      nokogiri (~> 1.6.0)
      rails-deprecated_sanitizer (>= 1.0.1)
    rails-html-sanitizer (1.0.3)
      loofah (~> 2.0)
    rails_admin (0.8.1)
      builder (~> 3.1)
      coffee-rails (~> 4.0)
      font-awesome-rails (>= 3.0, < 5)
      haml (~> 4.0)
      jquery-rails (>= 3.0, < 5)
      jquery-ui-rails (~> 5.0)
      kaminari (~> 0.14)
      nested_form (~> 0.3)
      rack-pjax (~> 0.7)
      rails (~> 4.0)
      remotipart (~> 1.0)
      safe_yaml (~> 1.0)
      sass-rails (>= 4.0, < 6)
    railties (4.2.6)
      actionpack (= 4.2.6)
      activesupport (= 4.2.6)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (11.2.2)
    rdoc (4.2.2)
      json (~> 1.4)
    remotipart (1.2.1)
    respond-rails (1.0.1)
      railties (>= 3.1.0)
    responders (2.2.0)
      railties (>= 4.2.0, < 5.1)
    rspec-core (3.4.4)
      rspec-support (~> 3.4.0)
    rspec-expectations (3.4.0)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-mocks (3.4.1)
      diff-lcs (>= 1.2.0, < 2.0)
      rspec-support (~> 3.4.0)
    rspec-rails (3.4.2)
      actionpack (>= 3.0, < 4.3)
      activesupport (>= 3.0, < 4.3)
      railties (>= 3.0, < 4.3)
      rspec-core (~> 3.4.0)
      rspec-expectations (~> 3.4.0)
      rspec-mocks (~> 3.4.0)
      rspec-support (~> 3.4.0)
    rspec-support (3.4.1)
    rubyzip (0.9.9)
    safe_yaml (1.0.4)
    sass (3.4.22)
    sass-rails (5.0.4)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (>= 1.1, < 3)
    sdoc (0.4.1)
      json (~> 1.7, >= 1.7.7)
      rdoc (~> 4.0)
    selenium-webdriver (2.35.1)
      childprocess (>= 0.2.5)
      multi_json (~> 1.0)
      rubyzip (< 1.0.0)
      websocket (~> 1.0.4)
    simple_form (3.0.4)
      actionpack (~> 4.0)
      activemodel (~> 4.0)
    sort_alphabetical (1.0.2)
      unicode_utils (>= 1.2.2)
    sprockets (3.6.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.4)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sshkit (1.11.1)
      net-scp (>= 1.1.2)
      net-ssh (>= 2.8.0)
    sshkit-sudo (0.1.0)
      sshkit (~> 1.8)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (2.0.5)
    turbolinks (2.5.3)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (3.0.0)
      execjs (>= 0.3.0, < 3)
    unicode_utils (1.4.0)
    warden (1.2.6)
      rack (>= 1.0)
    websocket (1.0.7)
    will_paginate (3.1.0)
    xpath (2.0.0)
      nokogiri (~> 1.3)

PLATFORMS
  ruby

DEPENDENCIES
  bcrypt (~> 3.1.7)
  bootstrap-sass
  capistrano (= 3.5.0)
  capistrano-nginx
  capistrano-rails
  capistrano-rails-console
  capistrano-rails-db
  capistrano-rvm
  capistrano-upload-config
  capistrano3-puma
  capybara (= 2.1.0)
  carrierwave
  coffee-rails (~> 4.0.0)
  country_select
  cucumber-rails (= 1.4.0)
  devise
  dynamic_sitemaps
  es5-shim-rails
  factory_girl_rails (= 4.2.0)
  file_validators
  font-awesome-rails
  html5shiv-rails
  jbuilder (~> 2.0)
  jquery-rails
  mail_form (~> 1.5.0.rc)
  mailboxer
  omniauth
  omniauth-facebook
  pg (= 0.15.1)
  rails (= 4.2.6)
  rails_admin
  respond-rails (~> 1.0)
  rspec-rails
  sass-rails
  sdoc (~> 0.4.0)
  selenium-webdriver (= 2.35.1)
  simple_form (~> 3.0.0.rc)
  sshkit-sudo
  turbolinks
  tzinfo-data
  uglifier (>= 1.3.0)
  will_paginate (~> 3.1)

更新 Gemfile。从块生产中删除 Gemfile.lock 并编辑 'pg' gem 并重新使用 'bundle install' 对我没有帮助。

4

1 回答 1

0

不知道您的 Gemfile 和 Gemfile.lock 是什么样子很难说,但只需删除您的 Gemfile.lock 文件并运行bundle install可能会解决问题!

你说:

解决方案是降级捆绑器。但现在我得到了其他错误。- Gem::LoadError: 为数据库适配器指定了“postgresql”,但未加载 gem。将 gem 'pg' 添加到您的 Gemfile

该怎么办:

在上面引用的 Gemfile 中,我看到您gem 'pg', '0.15.1'仅添加了组:development:test.

当你运行时cap production deploy,你将在生产模式下部署你的 Rails 应用程序,并且来自:developmentand:test组的 gem 将被忽略。

要解决此问题,请将 postgresql gem ( gem 'pg') 移出group :development, :test do块并将其放在 Gemfile 的顶部,即:

# Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '4.2.6'

# Use postgresql as the database for Active Record
gem 'pg'

# Other gems
# Use SCSS for stylesheets
gem 'sass-rails'
gem 'bootstrap-sass'
...
于 2016-06-27T20:52:07.660 回答