0

I got some error with my Gemfile.lock using comand 'cap production deploy'. How can i fix it?

Terminal:

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

Gemfile:

source '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

Gemfile lock:

  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)

Update Gemfile. Removing Gemfile.lock and edit 'pg' gem out of the block production and re-use 'bundle install' dont help me.

  • Make sure to run `bundle install` locally, then commit and push Gemfile *and* Gemfile.lock to the remote branch you are deploying. – Matt Brictson Jun 28 '16 at 00:55
  • solution was a downgrade the bundler. but now i got other error. - Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add `gem 'pg'` to your Gemfile – Vladyslav Kalyuzhnyy Jun 28 '16 at 07:55
  • You have `pg` in the `:development` group, which is incorrect. Move it to the top level of your Gemfile. – Matt Brictson Jun 28 '16 at 16:19

1 Answers1

0

It's hard to say without knowing what your Gemfile and Gemfile.lock look like, but simply deleting your Gemfile.lock file and running bundle install might solve the issue!

You said:

solution was a downgrade the bundler. but now i got other error. - Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add gem 'pg' to your Gemfile

What to do:

In your Gemfile referenced above, I see that you have added gem 'pg', '0.15.1' only for the groups :development and :test.

When you run cap production deploy, you will deploy your Rails app in production mode and gems from the :development and :test groups will be ignored.

To resolve the issue, move the postgresql gem (gem 'pg') out of group :development, :test do block and put it towards the top of your Gemfile, i.e.:

# 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'
...
Finn
  • 1,510
  • 13
  • 22
  • Sorry forget about it)) Delete gemfile lock and use bundle dont work..the same problem( – Vladyslav Kalyuzhnyy Jun 27 '16 at 20:57
  • Did you re-run `bundle install` afterwards? Can you update your Gemfile in the question? – Finn Jun 29 '16 at 08:56
  • Yes i did re-run bundle and it dont help me. Check update Gemfile – Vladyslav Kalyuzhnyy Jun 29 '16 at 09:04
  • And what's the error message you are getting now? Still: `Gem::LoadError: Specified 'postgresql' for database adapter, but the gem is not loaded. Add gem 'pg' to your Gemfile` ? – Finn Jun 29 '16 at 09:13
  • Yea. When i try to run 'cap production deploy'. – Vladyslav Kalyuzhnyy Jun 29 '16 at 09:33
  • Are you getting any other output or is that all? When you log into your server, can you check what your Gemfile.lock looks like there? I'm wondering whether this error occurs before or after deploying your Gemfile to the server. And I'm also wondering if your Gemfile is getting deployed correctly. – Finn Jun 29 '16 at 09:49
  • im running 'git pull origin master' into my vps and Gemfile / gemfile.lock the same as my files in development – Vladyslav Kalyuzhnyy Jun 29 '16 at 09:53
  • With Capistrano you should not be manually running `git pull origin master` in your VPS! Capistrano will do that for you. Are you using DigitalOcean for your VPS? There is an excellent guide for setting up Capistrano with Nginx and Puma on DigitalOcean: https://www.digitalocean.com/community/tutorials/deploying-a-rails-app-on-ubuntu-14-04-with-capistrano-nginx-and-puma – Finn Jun 29 '16 at 10:11
  • If you're manually pulling from Github, you could try to manually run `bundle install` from the directory that you're pulling into. And then attempt to run the server with `rails server production` -- but it'd be best to follow the instructions for setting up Capistrano as per the link above! – Finn Jun 29 '16 at 10:13
  • im using amazon ec2 – Vladyslav Kalyuzhnyy Jun 29 '16 at 20:43