鍍金池/ 問答/Ruby  網(wǎng)絡(luò)安全/ 運(yùn)行Jekyll serve ,顯示我已經(jīng)安裝過的 'jekyll-watch'

運(yùn)行Jekyll serve ,顯示我已經(jīng)安裝過的 'jekyll-watch' (~> 1.1)Could not find

win10系統(tǒng),剛剛拿了一個jekyll的模板后,想在本地打開看一看,進(jìn)入文件夾后,運(yùn)行Jekyll serve后報(bào)錯
錯誤代碼是:

WARN: Unresolved specs during Gem::Specification.reset:
      jekyll-watch (~> 1.1)
WARN: Clearing out unresolved specs.
Please report a bug if this causes problems.
D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:508:in `rescue in eval_gemspec':  (Bundler::Dsl::DSLError)
[!] There was an error parsing `Gemfile`:
[!] There was an error while loading `minimal-mistakes-jekyll.gemspec`: No such file or directory - git ls-files -z. Bundler cannot continue.

 #  from E:/WebFile/minimal-mistakes-master/minimal-mistakes-jekyll.gemspec:14
 #  -------------------------------------------
 #    spec.add_development_dependency "rake", "~> 10.0"
 >  end
 #  # coding: utf-8
 #  -------------------------------------------
. Bundler cannot continue.

 #  from E:/WebFile/minimal-mistakes-master/Gemfile:2
 #  -------------------------------------------
 #  source "https://rubygems.org"
 >  gemspec #  source "https://rubygems.org"
 #  -------------------------------------------
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:500:in `eval_gemspec'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:437:in `block in load_gemspec_uncached'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:65:in `chdir'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:65:in `block in chdir'
        from D:/Ruby24-x64/lib/ruby/2.4.0/monitor.rb:214:in `mon_synchronize'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/shared_helpers.rb:64:in `chdir'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:436:in `load_gemspec_uncached'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:422:in `load_gemspec'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/dsl.rb:66:in `block in gemspec'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/dsl.rb:66:in `map'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/dsl.rb:66:in `gemspec'
        from E:/WebFile/minimal-mistakes-master/Gemfile:2:in `eval_gemfile'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/dsl.rb:47:in `instance_eval'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/dsl.rb:47:in `eval_gemfile'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/dsl.rb:12:in `evaluate'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler/definition.rb:35:in `build'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:135:in `definition'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/bundler-1.16.0/lib/bundler.rb:101:in `setup'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/lib/jekyll/plugin_manager.rb:50:in `require_from_bundler'
        from D:/Ruby24-x64/lib/ruby/gems/2.4.0/gems/jekyll-3.6.2/exe/jekyll:11:in `<top (required)>'
        from D:/Ruby24-x64/bin/jekyll:23:in `load'
        from D:/Ruby24-x64/bin/jekyll:23:in `<main>'

而后我安裝 gem install jekyll-watch,再運(yùn)行Jekyll serve也是同樣的報(bào)錯

我再卸載這個控件后 gem cleanup jekyll-watch,重新安裝,也至這個問題。

我查看我的gem list 包含有jekyll-watch-2.0.0

這是我的環(huán)境:

RubyGems Environment:
  - RUBYGEMS VERSION: 2.6.13
  - RUBY VERSION: 2.4.2 (2017-09-14 patchlevel 198) [x64-mingw32]
  - INSTALLATION DIRECTORY: D:/Ruby24-x64/lib/ruby/gems/2.4.0
  - USER INSTALLATION DIRECTORY: C:/Users/Administrator/.gem/ruby/2.4.0
  - RUBY EXECUTABLE: D:/Ruby24-x64/bin/ruby.exe
  - EXECUTABLE DIRECTORY: D:/Ruby24-x64/bin
  - SPEC CACHE DIRECTORY: C:/Users/Administrator/.gem/specs
  - SYSTEM CONFIGURATION DIRECTORY: C:/ProgramData
  - RUBYGEMS PLATFORMS:
    - ruby
    - x64-mingw32
  - GEM PATHS:
     - D:/Ruby24-x64/lib/ruby/gems/2.4.0
     - C:/Users/Administrator/.gem/ruby/2.4.0
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - D:\Ruby24-x64\bin
     - D:\Ruby24-x64\bin
     - D:\Anaconda3
     - D:\Anaconda3\Library\mingw-w64\bin
     - D:\Anaconda3\Library\usr\bin
     - D:\Anaconda3\Library\bin
     - D:\Anaconda3\Scripts
     - C:\Windows\system32
     - C:\Windows
     - C:\Windows\System32\Wbem
     - C:\Windows\System32\WindowsPowerShell\v1.0\
     - C:\Users\Administrator\AppData\Local\Microsoft\WindowsApps
     - C:\Users\Administrator\AppData\Local\GitHubDesktop\bin
回答
編輯回答
雨蝶

ruby 用得不多,我猜測是你 Gemfile 有問題,如果 Gemfile 聲明的 gem 指向一個 github(或者別的什么情況),那么這個 gem 就應(yīng)該包含 gemspec,而你的報(bào)錯也說了這個問題,minimal-mistakes-jekyll.gemspec不存在,你解決下這個不存在的問題

2018年1月27日 01:20