我刚得到一份工作,我的第一项任务是创建当前代码的文档。如果有人能帮助我,我将不胜感激。
我在为文档设置代码时遇到了这个错误。我能够运行捆绑安装而不会出现任何错误。我试着用这个命令启动我的服务器
捆绑执行中间人服务器
但我得到错误
无法解析依赖项:用户请求的"did_you_mean(=1.2.0("(Gem::UnsatisfiableDependencyError(
这是我的错误的回溯:
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)
这是我的捆绑器环境
环境
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)
这是一个有点老的问题,所以我猜你已经解决了它,但这里是我对任何有类似问题的人的建议:
- 运行
gem list
,如果存在did_you_mean
,则尝试gem uninstall did_you_mean
;之后,重新运行bundle install
- 您可以尝试手动将
did_you_mean
添加到Gemfile:gem 'did_you_mean', '~>1.2.0'
- 如果其他方法都不起作用,请尝试升级到更新的Ruby:2.5.1对我来说似乎很旧——它的继任者Ruby 2.5.8是";在安全维护阶段(将很快EOL!(;根据Ruby网站,我正在使用Ruby 2.6.6成功地运行Middleman(4.3.11版本,尽管我记得4.0也在工作(
如果这些都不起作用/没有帮助,我深表歉意——但这是我的两分钱!
我也被这个IT问题困扰了整整一周,我的解决方案是只运行bundle install
,因为did_you_mean是默认的gem,所以无法卸载!请只运行bundle install
,因为这就是你所要做的,而不是像当前最佳答案所说的那样,试图不必要地卸载甚至无法首先卸载的默认gem。