0

It says that my Gemfile.lock is corrupt. The exact message is "Your Gemfile.lock is corrupt. The following gem is missing from the DEPENDENCIES section: 'mini_portile2'" How would I go about fixing this? This is also my Gemfile.lock:

 GEM
      remote: https://rubygems.org/
      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)
        arel (6.0.3)
        binding_of_caller (0.7.2)
          debug_inspector (>= 0.0.1)
        builder (3.2.2)
        byebug (5.0.0)
          columnize (= 0.9.0)
        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.9.1.1)
        columnize (0.9.0)
        debug_inspector (0.0.2)
        erubis (2.7.0)
        execjs (2.6.0)
        globalid (0.3.6)
          activesupport (>= 4.1.0)
        i18n (0.7.0)
        jbuilder (2.3.1)
          activesupport (>= 3.0.0, < 5)
          multi_json (~> 1.2)
        jquery-rails (4.0.5)
          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.6.1)
        minitest (5.8.4)
        multi_json (1.11.2)
        nokogiri (1.6.7.2)
        rack (1.6.4)
        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.6)
          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.6)
          actionpack (= 4.2.6)
          activesupport (= 4.2.6)
          rake (>= 0.8.7)
          thor (>= 0.18.1, < 2.0)
        rake (10.5.0)
        rdoc (4.2.1)
        sass (3.4.21)
        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)
        spring (1.3.6)
        sprockets (3.3.0)
          rack (~> 1.0)
        sprockets-rails (2.3.2)
          actionpack (>= 3.0)
          activesupport (>= 3.0)
          sprockets (>= 2.8, < 4.0)
        sqlite3 (1.3.11)
        thor (0.19.1)
        thread_safe (0.3.5)
        tilt (2.0.1)
        turbolinks (2.5.3)
          coffee-rails
        tzinfo (1.2.2)
          thread_safe (~> 0.1)
        uglifier (2.7.2)
          execjs (>= 0.3.0)
          json (>= 1.8.0)
        web-console (2.2.1)
          activemodel (>= 4.0)
          binding_of_caller (>= 0.7.2)
          railties (>= 4.0)
          sprockets-rails (>= 2.0, < 4.0)

    PLATFORMS
      ruby

    DEPENDENCIES
      byebug
      coffee-rails (~> 4.1.0)
      jbuilder (~> 2.0)
      jquery-rails
      rails (= 4.2.6)
      sass-rails (~> 5.0)
      sdoc (~> 0.4.0)
      spring
      sqlite3
      turbolinks
      uglifier (>= 1.3.0)
      web-console (~> 2.0)
    BUNDLED WITH
       1.11.2

How would I go about fixing this, exactly? If you need anymore information, I'd be willing to provide it!

Tom Lord
  • 27,404
  • 4
  • 50
  • 77
  • 2
    The "nuclear bomb" approach: `rm Gemfile.lock; bundle install`. – Tom Lord Jun 06 '18 at 16:19
  • The reason this is "nuclear" is that lots of other gem dependencies could get updated along the way. If this is a big application, and you need to be more careful about updating one thing at a time, don't do that. Otherwise, do. – Tom Lord Jun 06 '18 at 16:21
  • Do you have older versions of your Gemfile.lock in version control the way that every tutorial suggests you do? – Marc Talbot Jun 06 '18 at 16:21
  • 1
    Hi Nathan! Welcome to Stack Overflow! Please update your question with a more descriptive title. Imagine what it would be like if every Rails question here was titled "How to fix this issue?" – mikej Jun 06 '18 at 16:22
  • The "careful" approach: Figure out why this happened!! You should almost never edit the `Gemfile.lock` manually, but that appears to be what you've done here. Are you using source control? Can you `diff` the file, or otherwise check its history? – Tom Lord Jun 06 '18 at 16:22
  • Tom, I never edited the gemfile.lock. I just looked at it, without changing a single character or byte of code. – Nathan Tibbitts Jun 06 '18 at 16:30
  • @NathanTibbitts Unless something *very* unusual happened, you must have done, accidentally. Would you be able to give reproduction steps for your problem? I've tried "just looking at it", and it didn't break ;) – Tom Lord Jun 06 '18 at 16:35
  • Gemfile.lock is just a snapshot your Gemfile at a very moment you run `bundle install` . `bundle install` fetch all gems from your gemfile and adds some more dependent gems. It is unlikely that a dependency is missing. But if it is the case, just delete the Gemfile.lock and run a `bundle install` again. everything should be fine after that. Though as @TomLord advised, it will recreate a new snapshot of bundle install. Which may be different from your previous Gemfile.lock eventhough the Gemfile is the same. This happens because unversionned gems are updated. – Maxence Jun 06 '18 at 16:57
  • If all your gems are versioned like this `gem 'bootstrap-sass', '3.3.7'` then you should not really worry. Otherwise if you have gems like `gem 'devise'` it will probably update the gem Devise with a new version. You seem to be beginning a new application then dont worry too much and kill gemfile.lock and do a new bundle install. – Maxence Jun 06 '18 at 16:59
  • I tried the nuclear approach, and now I can't start the server. – Nathan Tibbitts Aug 15 '18 at 20:52
  • This is what happens when I try bundle install now. Note: I do not have sudo access as this is the family computer. https://pastebin.com/T1SiyE4Z – Nathan Tibbitts Aug 15 '18 at 20:54

1 Answers1

1

Delete the Gemfile.lock

and again do

bundle install