2

I am trying to push but says that it is failing to install gems. Already tried all the popular solutions on stack overflow but no luck. Please have a look!

Behemoth:website$ git push heroku master
Counting objects: 136, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (135/135), done.
Writing objects: 100% (136/136), 289.16 KiB | 0 bytes/s, done.
Total 136 (delta 71), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote: 
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: -----> Using Ruby version: ruby-2.0.0
remote: -----> Installing dependencies using bundler 1.9.7
remote:        Running: bundle install --without development:test --path vendor/bundle --binstubs vendor/bundle/bin -j4 --deployment
remote:        Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
remote:        Your Gemfile lists the gem rails (= 4.2.2) more than once.
remote:        You should probably keep only one of them.
remote:        While it's not a problem now, it could cause errors if you change the version of just one of them later.
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        You have added to the Gemfile:
remote:        * nokogiri (>= 1.5.11, ~> 1.5)
remote:        You have deleted from the Gemfile:
remote:        * nokogiri (>= 1.5.11, ~> 1.5)
remote:        Bundler Output: Warning: this Gemfile contains multiple primary sources. Using `source` more than once without a block is a security risk, and may result in installing unexpected gems. To resolve this warning, use a block to indicate which gems should come from the secondary source. To upgrade this warning to an error, run `bundle config disable_multisource true`.
remote:        Your Gemfile lists the gem rails (= 4.2.2) more than once.
remote:        You should probably keep only one of them.
remote:        While it's not a problem now, it could cause errors if you change the version of just one of them later.
remote:        You are trying to install in deployment mode after changing
remote:        your Gemfile. Run `bundle install` elsewhere and add the
remote:        updated Gemfile.lock to version control.
remote:        
remote:        You have added to the Gemfile:
remote:        * nokogiri (>= 1.5.11, ~> 1.5)
remote:        
remote:        You have deleted from the Gemfile:
remote:        * nokogiri (>= 1.5.11, ~> 1.5)
remote:  !
remote:  !     Failed to install gems via Bundler.
remote:  !
remote: 
remote:  !     Push rejected, failed to compile Ruby app
remote: 
remote: Verifying deploy...
remote: 
remote: !       Push rejected to website.
remote: 
To https://git.heroku.com/website.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/website.git'

I have already tried bundle update, git add ., git commit -m "message", git push heroku master

Here's my Gemfile.lock

 GEM
  remote: https://rubygems.org/
  specs:
    CFPropertyList (2.3.2)
    actionmailer (4.2.2)
      actionpack (= 4.2.2)
      actionview (= 4.2.2)
      activejob (= 4.2.2)
      mail (~> 2.5, >= 2.5.4)
      rails-dom-testing (~> 1.0, >= 1.0.5)
    actionpack (4.2.2)
      actionview (= 4.2.2)
      activesupport (= 4.2.2)
      rack (~> 1.6)
      rack-test (~> 0.6.2)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.1)
    actionview (4.2.2)
      activesupport (= 4.2.2)
      builder (~> 3.1)
      erubis (~> 2.7.0)
      rails-dom-testing (~> 1.0, >= 1.0.5)
      rails-html-sanitizer (~> 1.0, >= 1.0.1)
    activejob (4.2.2)
      activesupport (= 4.2.2)
      globalid (>= 0.3.0)
    activemodel (4.2.2)
      activesupport (= 4.2.2)
      builder (~> 3.1)
    activerecord (4.2.2)
      activemodel (= 4.2.2)
      activesupport (= 4.2.2)
      arel (~> 6.0)
    activesupport (4.2.2)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    arel (6.0.3)
    bcrypt (3.1.7)
    binding_of_caller (0.7.3.pre1)
      debug_inspector (>= 0.0.1)
    bootstrap-sass (3.2.0.0)
      sass (~> 3.2)
    bootstrap-will_paginate (0.0.10)
      will_paginate
    builder (3.2.2)
    byebug (3.4.0)
      columnize (~> 0.8)
      debugger-linecache (~> 1.2)
      slop (~> 3.6)
    carrierwave (0.10.0)
      activemodel (>= 3.2.0)
      activesupport (>= 3.2.0)
      json (>= 1.7)
      mime-types (>= 1.16)
    coffee-rails (4.1.0)
      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)
    columnize (0.9.0)
    concurrent-ruby (1.0.0)
    debug_inspector (0.0.2)
    debugger-linecache (1.2.0)
    erubis (2.7.0)
    excon (0.45.4)
    execjs (2.6.0)
    faker (1.4.2)
      i18n (~> 0.5)
    fission (0.5.0)
      CFPropertyList (~> 2.2)
    fog (1.36.0)
      fog-aliyun (>= 0.1.0)
      fog-atmos
      fog-aws (>= 0.6.0)
      fog-brightbox (~> 0.4)
      fog-core (~> 1.32)
      fog-dynect (~> 0.0.2)
      fog-ecloud (~> 0.1)
      fog-google (<= 0.1.0)
      fog-json
      fog-local
      fog-powerdns (>= 0.1.1)
      fog-profitbricks
      fog-radosgw (>= 0.0.2)
      fog-riakcs
      fog-sakuracloud (>= 0.0.4)
      fog-serverlove
      fog-softlayer
      fog-storm_on_demand
      fog-terremark
      fog-vmfusion
      fog-voxel
      fog-xenserver
      fog-xml (~> 0.1.1)
      ipaddress (~> 0.5)
      nokogiri (~> 1.5, >= 1.5.11)
    fog-aliyun (0.1.0)
      fog-core (~> 1.27)
      fog-json (~> 1.0)
      ipaddress (~> 0.8)
      xml-simple (~> 1.1)
    fog-atmos (0.1.0)
      fog-core
      fog-xml
    fog-aws (0.8.1)
      fog-core (~> 1.27)
      fog-json (~> 1.0)
      fog-xml (~> 0.1)
      ipaddress (~> 0.8)
    fog-brightbox (0.10.1)
      fog-core (~> 1.22)
      fog-json
      inflecto (~> 0.0.2)
    fog-core (1.35.0)
      builder
      excon (~> 0.45)
      formatador (~> 0.2)
    fog-dynect (0.0.2)
      fog-core
      fog-json
      fog-xml
    fog-ecloud (0.3.0)
      fog-core
      fog-xml
    fog-google (0.1.0)
      fog-core
      fog-json
      fog-xml
    fog-json (1.0.2)
      fog-core (~> 1.0)
      multi_json (~> 1.10)
    fog-local (0.2.1)
      fog-core (~> 1.27)
    fog-powerdns (0.1.1)
      fog-core (~> 1.27)
      fog-json (~> 1.0)
      fog-xml (~> 0.1)
    fog-profitbricks (0.0.5)
      fog-core
      fog-xml
      nokogiri
    fog-radosgw (0.0.5)
      fog-core (>= 1.21.0)
      fog-json
      fog-xml (>= 0.0.1)
    fog-riakcs (0.1.0)
      fog-core
      fog-json
      fog-xml
    fog-sakuracloud (1.7.5)
      fog-core
      fog-json
    fog-serverlove (0.1.2)
      fog-core
      fog-json
    fog-softlayer (1.0.3)
      fog-core
      fog-json
    fog-storm_on_demand (0.1.1)
      fog-core
      fog-json
    fog-terremark (0.1.0)
      fog-core
      fog-xml
    fog-vmfusion (0.1.0)
      fission
      fog-core
    fog-voxel (0.1.0)
      fog-core
      fog-xml
    fog-xenserver (0.2.3)
      fog-core
      fog-xml
    fog-xml (0.1.2)
      fog-core
      nokogiri (~> 1.5, >= 1.5.11)
    formatador (0.2.5)
    globalid (0.3.6)
      activesupport (>= 4.1.0)
    i18n (0.7.0)
    inflecto (0.0.2)
    ipaddress (0.8.2)
    jbuilder (2.2.3)
      activesupport (>= 3.0.0, < 5)
      multi_json (~> 1.2)
    jquery-rails (4.0.3)
      rails-dom-testing (~> 1.0)
      railties (>= 4.2.0)
      thor (>= 0.14, < 2.0)
    json (1.8.3)
    loofah (2.0.3)
      nokogiri (>= 1.5.9)
    mail (2.6.3)
      mime-types (>= 1.16, < 3)
    mime-types (2.99)
    mini_magick (3.8.0)
      subexec (~> 0.2.1)
    mini_portile2 (2.0.0)
    minitest (5.8.4)
    modernizr-rails (2.7.1)
    multi_json (1.11.2)
    nokogiri (1.6.7.2)
      mini_portile2 (~> 2.0.0.rc2)
    pg (0.18.4)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rails (4.2.2)
      actionmailer (= 4.2.2)
      actionpack (= 4.2.2)
      actionview (= 4.2.2)
      activejob (= 4.2.2)
      activemodel (= 4.2.2)
      activerecord (= 4.2.2)
      activesupport (= 4.2.2)
      bundler (>= 1.3.0, < 2.0)
      railties (= 4.2.2)
      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)
    railties (4.2.2)
      actionpack (= 4.2.2)
      activesupport (= 4.2.2)
      rake (>= 0.8.7)
      thor (>= 0.18.1, < 2.0)
    rake (10.5.0)
    rdoc (4.2.1)
      json (~> 1.4)
    sass (3.4.21)
    sass-rails (5.0.2)
      railties (>= 4.0.0, < 5.0)
      sass (~> 3.1)
      sprockets (>= 2.8, < 4.0)
      sprockets-rails (>= 2.0, < 4.0)
      tilt (~> 1.1)
    sdoc (0.4.0)
      json (~> 1.8)
      rdoc (~> 4.0, < 5.0)
    slop (3.6.0)
    spring (1.1.3)
    sprockets (3.5.2)
      concurrent-ruby (~> 1.0)
      rack (> 1, < 3)
    sprockets-rails (3.0.1)
      actionpack (>= 4.0)
      activesupport (>= 4.0)
      sprockets (>= 3.0.0)
    sqlite3 (1.3.9)
    subexec (0.2.3)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (1.4.1)
    turbolinks (2.3.0)
      coffee-rails
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.5.3)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    web-console (2.0.0.beta3)
      activemodel (~> 4.0)
      binding_of_caller (= 0.7.3.pre1)
      railties (~> 4.0)
      sprockets-rails (>= 2.0, < 4.0)
    will_paginate (3.0.7)
    wow-rails (0.0.1)
    xml-simple (1.1.5)

PLATFORMS
  ruby

DEPENDENCIES
  bcrypt (= 3.1.7)
  bootstrap-sass (= 3.2.0.0)
  bootstrap-will_paginate (= 0.0.10)
  byebug (= 3.4.0)
  carrierwave (= 0.10.0)
  coffee-rails (= 4.1.0)
  faker (= 1.4.2)
  fog (= 1.36.0)
  jbuilder (= 2.2.3)
  jquery-rails (= 4.0.3)
  mini_magick (= 3.8.0)
  modernizr-rails
  nokogiri (~> 1.5, >= 1.5.11)
  pg (= 0.18.4)
  rails (= 4.2.2)
  sass-rails (= 5.0.2)
  sdoc (= 0.4.0)
  spring (= 1.1.3)
  sqlite3 (= 1.3.9)
  turbolinks (= 2.3.0)
  uglifier (= 2.5.3)
  web-console (= 2.0.0.beta3)
  will_paginate (= 3.0.7)
  wow-rails

BUNDLED WITH
   1.11.2
mantrarush
  • 47
  • 1
  • 7

2 Answers2

0

Try the following, update your bundler:

gem update bundler

Would be helpful if you publish your gem file too. This issue may be happening because your you Gemfile and your .lock do not concord, for discard it please delete your Gemfile.lock and generate it again running bundle install

As for the investigation procedure, you can copy old gemfile.lock to a secure place, then regenerate the gemfile.lock, and compare them with diff

if the above does not work please read this topic with several solutions related to your issue, try them all.

Community
  • 1
  • 1
svelandiag
  • 4,231
  • 1
  • 36
  • 72
  • Already tried using gem update bundler. Did not work. Will have a look at the link, thanks! – mantrarush Jan 30 '16 at 09:31
  • Sure, let us know if you could fix it, also do not forget to mark this answer. – svelandiag Jan 30 '16 at 16:16
  • Did you deleted your gemfile.lock? regenerated it again? – svelandiag Jan 30 '16 at 16:23
  • I did delete gemfile.lock and regenerate but it did not work. Turns out I had tried all those solutions before posting this question. As of now, I managed to deploy the app. I ended up removing two gem files that I hadn't really been using and that helped me do the push. I am not sure whether there was a conflict between the requirements for the gems, which was causing the issue. The ones I deleted were fog, and nokogiri. – mantrarush Jan 30 '16 at 22:06
0

I ended up removing two gem files that I hadn't really been using and that helped me do the push. I am not sure whether there was a conflict between the requirements for the gems, which was causing the issue. The ones I deleted were fog, and nokogiri

mantrarush
  • 47
  • 1
  • 7