2017-02-23 154 views
3
  1. 我正在捆绑已更新,当我运行bundle update
  2. 的Json 1.8.6安装。宝石:: Specification.reset中未解决的规格:
  3. 但是当我运行杰基尔构建,我得到这个错误:为什么我无法安装JSON gem?

    WARN 听(< 3.1〜> 3.0) 警告:清理出未解决的规格。 如果这导致问题,请报告错误。 /usr/local/lib/ruby/gems/2.4.0/gems/bundler-1.14.5/lib/bundler/runtime.rb:40:in block in setup': You have already activated json 2.0.2, but your Gemfile requires json 1.8.6. Prepending bundle exec` to your command may solve this。 (宝石:: LoadError)

+0

作为警告建议你可以在前面加上'捆绑exec'你的指挥 –

回答

4

好像你安装json多个版本,并错误的版本正在使用

Prepending bundle exec to your command may solve this.

由于警告建议你可以在命令前加上bundle exec。这将确保使用您的Gemfile中提到的Gem版本。

bundle exec jekyll build 

bundle exec jekyll serve 
+0

所以,从现在开始,我无法用捆绑服务?总是使用exec?它的工作,虽然。谢谢。 – maximusdooku

+0

bundle exec只是确保使用正确的gem版本 –

+0

@maximusdooku:alias j ='bundle exec jekyll' - 让你“j服务”。更容易! – djb