Unable to resolve dependency: user requested 'did_you_mean (= 1.2.0)' (Gem::UnsatisfiableDependencyError)
Asked Answered
B

2

6

I just got a job and my first task is to create a documentation of our current code. I would really appreciate it if someone could help me.

I'm got this error setting up the code for the documentation. I was able to run bundle install without getting any errors. I tried to start my server using this command

bundle exec middleman server

but I get the error

Unable to resolve dependency: user requested 'did_you_mean (= 1.2.0)' (Gem::UnsatisfiableDependencyError)

Here's a traceback of my error:

    Traceback (most recent call last):
        20: from /Users/reneesarmiento/.rbenv/versions/2.5.1/bin/middleman:23:in `<main>'
        19: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:309:in `activate_bin_path'
        18: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:309:in `synchronize'
        17: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:311:in `block in activate_bin_path'
        16: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems.rb:243:in `finish_resolve'
        15: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/request_set.rb:397:in `resolve_current'
        14: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/request_set.rb:385:in `resolve'
        13: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:188:in `resolve'
        12: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolver.rb:42:in `resolve'
        11: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:64:in `resolve'
        10: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:106:in `start_resolution'
         9: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/resolution.rb:165:in `initial_state'
         8: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:51:in `sort_dependencies'
         7: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:69:in `with_no_such_dependency_error_handling'
         6: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver/molinillo/lib/molinillo/delegates/specification_provider.rb:52:in `block in sort_dependencies'
         5: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `sort_dependencies'
         4: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `with_index'
         3: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `sort_by'
         2: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:277:in `each'
         1: from /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:283:in `block in sort_dependencies'
    /Users/reneesarmiento/.rbenv/versions/2.5.1/lib/ruby/2.5.0/rubygems/resolver.rb:231:in `search_for': Unable to resolve dependency: user requested 'did_you_mean (= 1.2.0)' (Gem::UnsatisfiableDependencyError)

here is my bundler environment

Environment

Bundler   1.10.6
Rubygems  2.7.6
Ruby      2.5.1p57 (2018-03-29 revision 63029) [x86_64-darwin18]
Git       2.20.1 (Apple Git-117)

Gemfile

source 'https://rubygems.org'

ruby '2.5.1'
# Middleman
gem 'middleman', '~>4.0.0'
gem 'middleman-gh-pages', '~> 0.0.3'
gem 'middleman-syntax', '~> 2.1.0'
gem 'middleman-autoprefixer', '~> 2.7.0'
gem 'middleman-sprockets', "~> 4.0.0.rc"
gem 'rouge', '~> 1.10.1'
gem 'redcarpet', '~> 3.3.2'

Gemfile.lock

GEM
  remote: https://rubygems.org/
  specs:
    activesupport (4.2.5.1)
      i18n (~> 0.7)
      json (~> 1.7, >= 1.7.7)
      minitest (~> 5.1)
      thread_safe (~> 0.3, >= 0.3.4)
      tzinfo (~> 1.1)
    addressable (2.4.0)
    autoprefixer-rails (6.3.1)
      execjs
      json
    backports (3.6.7)
    capybara (2.5.0)
      mime-types (>= 1.16)
      nokogiri (>= 1.3.3)
      rack (>= 1.0.0)
      rack-test (>= 0.5.4)
      xpath (~> 2.0)
    coffee-script (2.4.1)
      coffee-script-source
      execjs
    coffee-script-source (1.10.0)
    compass-import-once (1.0.5)
      sass (>= 3.2, < 3.5)
    concurrent-ruby (0.9.2)
    contracts (0.12.0)
    erubis (2.7.0)
    execjs (2.6.0)
    fastimage (1.8.1)
      addressable (~> 2.3, >= 2.3.5)
    ffi (1.9.10)
    haml (4.0.7)
      tilt
    hamster (2.0.0)
      concurrent-ruby (~> 0.8)
    hashie (3.4.3)
    i18n (0.7.0)
    json (1.8.6)
    kramdown (1.9.0)
    listen (3.0.5)
      rb-fsevent (>= 0.9.3)
      rb-inotify (>= 0.9)
    middleman (4.0.0)
      coffee-script (~> 2.2)
      compass-import-once (= 1.0.5)
      haml (>= 4.0.5)
      kramdown (~> 1.2)
      middleman-cli (= 4.0.0)
      middleman-core (= 4.0.0)
      sass (>= 3.4.0, < 4.0)
    middleman-autoprefixer (2.7.0)
      autoprefixer-rails (>= 6.3.1, < 7.0.0)
      middleman-core (>= 3.3.3)
    middleman-cli (4.0.0)
      thor (>= 0.17.0, < 2.0)
    middleman-core (4.0.0)
      activesupport (~> 4.2)
      addressable (~> 2.4.0)
      backports (~> 3.6)
      bundler (~> 1.1)
      capybara (~> 2.5.0)
      contracts (~> 0.12.0)
      erubis
      execjs (~> 2.0)
      fastimage (~> 1.8)
      hamster (~> 2.0)
      hashie (~> 3.4)
      i18n (~> 0.7.0)
      listen (~> 3.0)
      padrino-helpers (~> 0.13.0)
      rack (>= 1.4.5, < 2.0)
      sass (>= 3.4)
      tilt (~> 1.4.1)
      uglifier (~> 2.6)
    middleman-gh-pages (0.0.3)
      rake (> 0.9.3)
    middleman-sprockets (4.0.0.rc.1)
      middleman-core (>= 4.0.0.rc.1)
      sprockets (~> 3.0)
    middleman-syntax (2.1.0)
      middleman-core (>= 3.2)
      rouge (~> 1.0)
    mime-types (3.0)
      mime-types-data (~> 3.2015)
    mime-types-data (3.2015.1120)
    mini_portile2 (2.0.0)
    minitest (5.8.4)
    nokogiri (1.6.7.2)
      mini_portile2 (~> 2.0.0.rc2)
    padrino-helpers (0.13.1)
      i18n (~> 0.6, >= 0.6.7)
      padrino-support (= 0.13.1)
      tilt (~> 1.4.1)
    padrino-support (0.13.1)
      activesupport (>= 3.1)
    rack (1.6.4)
    rack-test (0.6.3)
      rack (>= 1.0)
    rake (10.4.2)
    rb-fsevent (0.9.7)
    rb-inotify (0.9.5)
      ffi (>= 0.5.0)
    redcarpet (3.3.4)
    rouge (1.10.1)
    sass (3.4.21)
    sprockets (3.4.1)
      rack (> 1, < 3)
    thor (0.19.1)
    thread_safe (0.3.5)
    tilt (1.4.1)
    tzinfo (1.2.2)
      thread_safe (~> 0.1)
    uglifier (2.7.2)
      execjs (>= 0.3.0)
      json (>= 1.8.0)
    xpath (2.0.0)
      nokogiri (~> 1.3)
Birdiebirdlike answered 16/7, 2020 at 9:58 Comment(2)
What is your bundle env? Did running bundle install complete without errors? Are you confident that ruby version 2.5.1 is a valid version to be using on that project? Are you able to create a minimal reproducible example of the problem, i.e. a minimal Gemfile and Gemfile.lock that anyone on the internet could use to reproduce an identical error to what you're seeing above?Thimblerig
Hi @TomLord! Sorry about that, I just updated my question. But yes, I was able to complete bundle install without any errors. My supervisor set the ruby version inside the Gemfile to 2.5.1. I apologize because I just started ruby today, what do you mean by a minimal Gemfile and Gemfile.lock?Birdiebirdlike
F
8

I got stuck on this IT issue for a whole week too and the solution for me was to just run bundle install only because did_you_mean can't be uninstalled as it is a default gem! Please just run bundle install instead only because that's all you have to do instead of getting stuck trying to unnecessarily uninstall default gems that can't even be uninstalled first as stated by the current best answer.

Fiddle answered 24/3, 2022 at 23:8 Comment(0)
M
4

Edit (January 2024): the other answer is likely better! I don't remember what my thought process was with this nearly three years ago, but it's correct that did_you_mean is a default gem and can't be uninstalled. I think I had probably just been coming up with ideas to try when I wrote that. Thanks to the other person for clarifying that!

My original answer:

This is a bit of an old question, so I'm guessing you've fixed it, but nonetheless here are my suggestions for anyone with a similar issue:

  1. Run gem list, and if did_you_mean is there, try gem uninstall did_you_mean; after that, re-run bundle install
  2. You could try manually adding did_you_mean to your Gemfile: gem 'did_you_mean', '~>1.2.0'
  3. If nothing else works, try upgrading to a newer Ruby: 2.5.1 seems pretty old to me — its successor, Ruby 2.5.8, is "in security maintenance phase (will EOL soon!)" per the Ruby website, and I'm running Middleman (version 4.3.11, though I recall 4.0 also working) successfully with Ruby 2.6.6.

Apologies if none of this works/is helpful — but there's my two cents!

Mier answered 13/3, 2021 at 22:56 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.