简体   繁体   中英

Cannot run Jekyll (macOS Sierra) even with bundle exec

Having all sorts of problems with Jekyll after upgrading to macOS Sierra (10.12). Running jekyll build fails with this error (this has long happened to me): /Library/Ruby/Gems/2.0.0/gems/bundler1.12.5/lib/bundler/runtime.rb:35:in block in setup: You have already activated colorator 1.1.0, but your Gemfile requires colorator 0.1. Prepending /Library/Ruby/Gems/2.0.0/gems/bundler1.12.5/lib/bundler/runtime.rb:35:in block in setup: You have already activated colorator 1.1.0, but your Gemfile requires colorator 0.1. Prepending bundle exec to your command may solve this. (Gem::LoadError) to your command may solve this. (Gem::LoadError) .

In the past running bundle exec jekyll serve has fixed this problem, but now when I run that, I get the error:

Liquid Exception: cannot load such file -- rouge in _posts/2015-12-20-welcome-to-jekyll.markdown bundler: failed to load command: jekyll (/usr/local/bin/jekyll) LoadError: cannot load such file -- rouge

First thought was to try to reinstall rouge, so ran sudo gem install rouge , but that didn't do anything. Also tried uninstalling and reinstalling jekyll. I also checked the /usr/local/bin/jekyll path, and jekyll is in there. Not really sure how to fix this problem (or what the problem is). thoughts?

Instead of running jekyll commands, try using bundle instead. This bundle prefix will load the proper gemset as specified in Gemfile .

in the root project directory try:

bundle install
bundle exec jekyll build && bundle exec jekyll serve

I just came across the same problem and fixed it.

First, do this

  • sudo gem install bundler
  • bundle install

At last, intall jekyll again

  • sudo gem install jekyll

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM