title: Heroku: Failed to install gems via Bundler, could not push app
body: <p>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!</p>
  
  <pre><code>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: -----&gt; Ruby app detected
  remote: -----&gt; Compiling Ruby/Rails
  remote: -----&gt; Using Ruby version: ruby-2.0.0
  remote: -----&gt; 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 (&gt;= 1.5.11, ~&gt; 1.5)
  remote:        You have deleted from the Gemfile:
  remote:        * nokogiri (&gt;= 1.5.11, ~&gt; 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 (&gt;= 1.5.11, ~&gt; 1.5)
  remote:        
  remote:        You have deleted from the Gemfile:
  remote:        * nokogiri (&gt;= 1.5.11, ~&gt; 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 -&gt; master (pre-receive hook declined)
  error: failed to push some refs to 'https://git.heroku.com/website.git'
  </code></pre>
  
  <p>I have already tried bundle update, git add ., git commit -m "message", git push heroku master</p>
  
  <p>Here's my Gemfile.lock</p>
  
  <pre><code> 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 (~&gt; 2.5, &gt;= 2.5.4)
        rails-dom-testing (~&gt; 1.0, &gt;= 1.0.5)
      actionpack (4.2.2)
        actionview (= 4.2.2)
        activesupport (= 4.2.2)
        rack (~&gt; 1.6)
        rack-test (~&gt; 0.6.2)
        rails-dom-testing (~&gt; 1.0, &gt;= 1.0.5)
        rails-html-sanitizer (~&gt; 1.0, &gt;= 1.0.1)
      actionview (4.2.2)
        activesupport (= 4.2.2)
        builder (~&gt; 3.1)
        erubis (~&gt; 2.7.0)
        rails-dom-testing (~&gt; 1.0, &gt;= 1.0.5)
        rails-html-sanitizer (~&gt; 1.0, &gt;= 1.0.1)
      activejob (4.2.2)
        activesupport (= 4.2.2)
        globalid (&gt;= 0.3.0)
      activemodel (4.2.2)
        activesupport (= 4.2.2)
        builder (~&gt; 3.1)
      activerecord (4.2.2)
        activemodel (= 4.2.2)
        activesupport (= 4.2.2)
        arel (~&gt; 6.0)
      activesupport (4.2.2)
        i18n (~&gt; 0.7)
        json (~&gt; 1.7, &gt;= 1.7.7)
        minitest (~&gt; 5.1)
        thread_safe (~&gt; 0.3, &gt;= 0.3.4)
        tzinfo (~&gt; 1.1)
      arel (6.0.3)
      bcrypt (3.1.7)
      binding_of_caller (0.7.3.pre1)
        debug_inspector (&gt;= 0.0.1)
      bootstrap-sass (3.2.0.0)
        sass (~&gt; 3.2)
      bootstrap-will_paginate (0.0.10)
        will_paginate
      builder (3.2.2)
      byebug (3.4.0)
        columnize (~&gt; 0.8)
        debugger-linecache (~&gt; 1.2)
        slop (~&gt; 3.6)
      carrierwave (0.10.0)
        activemodel (&gt;= 3.2.0)
        activesupport (&gt;= 3.2.0)
        json (&gt;= 1.7)
        mime-types (&gt;= 1.16)
      coffee-rails (4.1.0)
        coffee-script (&gt;= 2.2.0)
        railties (&gt;= 4.0.0, &lt; 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 (~&gt; 0.5)
      fission (0.5.0)
        CFPropertyList (~&gt; 2.2)
      fog (1.36.0)
        fog-aliyun (&gt;= 0.1.0)
        fog-atmos
        fog-aws (&gt;= 0.6.0)
        fog-brightbox (~&gt; 0.4)
        fog-core (~&gt; 1.32)
        fog-dynect (~&gt; 0.0.2)
        fog-ecloud (~&gt; 0.1)
        fog-google (&lt;= 0.1.0)
        fog-json
        fog-local
        fog-powerdns (&gt;= 0.1.1)
        fog-profitbricks
        fog-radosgw (&gt;= 0.0.2)
        fog-riakcs
        fog-sakuracloud (&gt;= 0.0.4)
        fog-serverlove
        fog-softlayer
        fog-storm_on_demand
        fog-terremark
        fog-vmfusion
        fog-voxel
        fog-xenserver
        fog-xml (~&gt; 0.1.1)
        ipaddress (~&gt; 0.5)
        nokogiri (~&gt; 1.5, &gt;= 1.5.11)
      fog-aliyun (0.1.0)
        fog-core (~&gt; 1.27)
        fog-json (~&gt; 1.0)
        ipaddress (~&gt; 0.8)
        xml-simple (~&gt; 1.1)
      fog-atmos (0.1.0)
        fog-core
        fog-xml
      fog-aws (0.8.1)
        fog-core (~&gt; 1.27)
        fog-json (~&gt; 1.0)
        fog-xml (~&gt; 0.1)
        ipaddress (~&gt; 0.8)
      fog-brightbox (0.10.1)
        fog-core (~&gt; 1.22)
        fog-json
        inflecto (~&gt; 0.0.2)
      fog-core (1.35.0)
        builder
        excon (~&gt; 0.45)
        formatador (~&gt; 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 (~&gt; 1.0)
        multi_json (~&gt; 1.10)
      fog-local (0.2.1)
        fog-core (~&gt; 1.27)
      fog-powerdns (0.1.1)
        fog-core (~&gt; 1.27)
        fog-json (~&gt; 1.0)
        fog-xml (~&gt; 0.1)
      fog-profitbricks (0.0.5)
        fog-core
        fog-xml
        nokogiri
      fog-radosgw (0.0.5)
        fog-core (&gt;= 1.21.0)
        fog-json
        fog-xml (&gt;= 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 (~&gt; 1.5, &gt;= 1.5.11)
      formatador (0.2.5)
      globalid (0.3.6)
        activesupport (&gt;= 4.1.0)
      i18n (0.7.0)
      inflecto (0.0.2)
      ipaddress (0.8.2)
      jbuilder (2.2.3)
        activesupport (&gt;= 3.0.0, &lt; 5)
        multi_json (~&gt; 1.2)
      jquery-rails (4.0.3)
        rails-dom-testing (~&gt; 1.0)
        railties (&gt;= 4.2.0)
        thor (&gt;= 0.14, &lt; 2.0)
      json (1.8.3)
      loofah (2.0.3)
        nokogiri (&gt;= 1.5.9)
      mail (2.6.3)
        mime-types (&gt;= 1.16, &lt; 3)
      mime-types (2.99)
      mini_magick (3.8.0)
        subexec (~&gt; 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 (~&gt; 2.0.0.rc2)
      pg (0.18.4)
      rack (1.6.4)
      rack-test (0.6.3)
        rack (&gt;= 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 (&gt;= 1.3.0, &lt; 2.0)
        railties (= 4.2.2)
        sprockets-rails
      rails-deprecated_sanitizer (1.0.3)
        activesupport (&gt;= 4.2.0.alpha)
      rails-dom-testing (1.0.7)
        activesupport (&gt;= 4.2.0.beta, &lt; 5.0)
        nokogiri (~&gt; 1.6.0)
        rails-deprecated_sanitizer (&gt;= 1.0.1)
      rails-html-sanitizer (1.0.3)
        loofah (~&gt; 2.0)
      railties (4.2.2)
        actionpack (= 4.2.2)
        activesupport (= 4.2.2)
        rake (&gt;= 0.8.7)
        thor (&gt;= 0.18.1, &lt; 2.0)
      rake (10.5.0)
      rdoc (4.2.1)
        json (~&gt; 1.4)
      sass (3.4.21)
      sass-rails (5.0.2)
        railties (&gt;= 4.0.0, &lt; 5.0)
        sass (~&gt; 3.1)
        sprockets (&gt;= 2.8, &lt; 4.0)
        sprockets-rails (&gt;= 2.0, &lt; 4.0)
        tilt (~&gt; 1.1)
      sdoc (0.4.0)
        json (~&gt; 1.8)
        rdoc (~&gt; 4.0, &lt; 5.0)
      slop (3.6.0)
      spring (1.1.3)
      sprockets (3.5.2)
        concurrent-ruby (~&gt; 1.0)
        rack (&gt; 1, &lt; 3)
      sprockets-rails (3.0.1)
        actionpack (&gt;= 4.0)
        activesupport (&gt;= 4.0)
        sprockets (&gt;= 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 (~&gt; 0.1)
      uglifier (2.5.3)
        execjs (&gt;= 0.3.0)
        json (&gt;= 1.8.0)
      web-console (2.0.0.beta3)
        activemodel (~&gt; 4.0)
        binding_of_caller (= 0.7.3.pre1)
        railties (~&gt; 4.0)
        sprockets-rails (&gt;= 2.0, &lt; 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 (~&gt; 1.5, &gt;= 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
  </code></pre>