2
votes

I have this jekyll project https://github.com/mmistakes/minimal-mistakes

If I run jekyll serve this error is displayed.

WARN: Unresolved specs during Gem::Specification.reset: listen (< 3.1, ~> 3.0) WARN: Clearing out unresolved specs. Please report a bug if this causes problems. Configuration file: /home/kenden/Desktop/minimal-mistakes-master/_config.yml Dependency Error: Yikes! It looks like you don't have jekyll-paginate or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-paginate' If you run into trouble, you can find helpful resources at http://jekyllrb.com/help/! jekyll 3.1.3 | Error: jekyll-paginate

I already have jekyll paginate installed. I checked using gem list. However if I run bundle exec jekyll serve then the server starts perfectly.

Configuration file: /home/kenden/Desktop/minimal-mistakes-master/_config.yml Source: /home/kenden/Desktop/minimal-mistakes-master Destination: /home/kenden/Desktop/minimal-mistakes-master/_site Incremental build: disabled. Enable with --incremental Generating... done in 0.104 seconds. Auto-regeneration: enabled for '/home/kenden/Desktop/minimal-mistakes-master' Configuration file: /home/kenden/Desktop/minimal-mistakes-master/_config.yml Server address: http://127.0.0.1:4000 Server running... press ctrl-c to stop.

Why is jekyll serve not working and what is difference between jekyll serve and bundle exec jekyll serve ?

2

2 Answers

2
votes

The Rationale and Purpose of Bundler will probably shed some light on the difference. Most likely you have more than one version of the gem on your system Ruby and it's probably unsure which version to use.

If you don't want to always have to type bundle exec read this article from the Thoughtbot blog

2
votes

I also met this problem and I solved it by uninstall all the different versions of gems comparing with Gemfile.lock.

For example, I found this gem have two different versions: jekyll-sass-converter (1.4.0, 1.3.0). And in Gemfile.lock, there is only jekyll-sass-converter (= 1.3.0). So I uninstalled its 1.4.0 version. Then Jekyll serve works as expect.

I think the difference between Jekyll serve and bundle exec Jekyll serve is that bundle exec will check the Gemfile.lock and use the specific versions of gems in it while Jekyll serve somehow confused by the different versions of the same gem.