Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What's the difference between 'bundle exec jekyll serve' and 'jekyll serve'?

I'm currently learning Jekyll, a framework for building websites, and I don't know what's the difference between bundle exec jekyll serve and jekyll serve. Both seem to behave the same.

like image 825
Cequiel Avatar asked Jul 03 '18 14:07

Cequiel


People also ask

What does bundle exec jekyll serve do?

When you run bundle exec jekyll serve, Bundler uses the gems and versions as specified in Gemfile. lock to ensure your Jekyll site builds with no compatibility or dependency conflicts. The Gemfile and Gemfile. lock files inform Bundler about the gem requirements in your site.


1 Answers

In two words:

bundle exec jekyll serve - runs the exact jekyll server version that is specified in your Gemfile/Gemfile.lock.

jekyll serve - runs some version of jekyll server, which may or may not be the one you want.

For best results, always use bundle exec. On my machine, I have a shell alias for it, so that I can type

be jekyll serve
like image 143
Sergio Tulentsev Avatar answered Sep 20 '22 14:09

Sergio Tulentsev