How to fix: bundler: command not found: jekyll
We can set up a local version of our Jekyll GitHub Pages website to preview our website before making the changes public. But after upgrading MacOS to version “High Sierra” on my MacBook, when I run the jekyll bundle exec jekyll serve
command it throws the following error message:
$ bundle exec jekyll serve bundler: command not found: jekyll Install missing gem executables with `bundle install`
What causes this error
This error message is self explanatory. It means that we are trying to use the Jekyll gem while it is not installed in our system. It also tells us what exactly we need to do to solve this problem.
How to solve it
To solve this problem we will do as said in the error message:
bundle install
Fetching gem metadata from https://rubygems.org/......... Using i18n 0.8.4 Using minitest 5.10.2 Using thread_safe 0.3.6 Using tzinfo 1.2.3 Using activesupport 4.2.8 Using addressable 2.4.0 Using bundler 1.16.0.pre.3 Using coffee-script-source 1.12.2 Using execjs 2.7.0 Using coffee-script 2.4.1 Using colorator 0.1 Fetching ffi 1.9.18 Your user account isn't allowed to install to the system RubyGems. You can cancel this installation and run: bundle install --path vendor/bundle to install the gems into ./vendor/bundle/, or you can enter your password and install the bundled gems to RubyGems using sudo. Password:
Enter your password after prompted and then watch the magic happen…
Password: Installing ffi 1.9.18 with native extensions Fetching ethon 0.10.1 Installing ethon 0.10.1 Using multipart-post 2.0.0 ... Fetching jekyll-github-metadata 1.11.1 Installing jekyll-github-metadata 1.11.1 Using mini_portile2 2.0.0 Fetching nokogiri 1.6.7.2 Installing nokogiri 1.6.7.2 with native extensions Your user account isn't allowed to install to the system RubyGems. You can cancel this installation and run: bundle install --path vendor/bundle to install the gems into ./vendor/bundle/, or you can enter your password and install the bundled gems to RubyGems using sudo. Password: Fetching html-pipeline 2.4.0 Installing html-pipeline 2.4.0 Fetching jekyll-mentions 1.1.2 ... Fetching terminal-table 1.8.0 Installing terminal-table 1.8.0 Fetching github-pages 78 Installing github-pages 78 Bundle complete! 1 Gemfile dependency, 50 gems now installed. Use `bundle info [gemname]` to see where a bundled gem is installed. Post-install message from html-pipeline: ------------------------------------------------- Thank you for installing html-pipeline! You must bundle Filter gem dependencies. See html-pipeline README.md for more details. https://github.com/jch/html-pipeline#dependencies ------------------------------------------------- Post-install message from github-pages: --------------------------------------------------- Thank you for installing github-pages! GitHub Pages recently upgraded to Jekyll 3.0, which includes some breaking changes. More information: https://github.com/blog/2100-github-pages-jekyll-3 ---------------------------------------------------
Note! If you received an error message when using the bundle install command, then read this article.
Looks good. Let’s now try to run the bundle exec jekyll serve
command again:
bundle exec jekyll serve
Configuration file: /Users/user/GitHub/website/_config.yml Source: /Users/user/GitHub/website Destination: /Users/user/GitHub/website/_site Incremental build: disabled. Enable with --incremental Generating... done in 20.539 seconds. Auto-regeneration: enabled for '/Users/user/GitHub/website' Configuration file: /Users/user/GitHub/website/_config.yml Server address: http://127.0.0.1:4000/ Server running... press ctrl-c to stop.
And it works.
Conclusion
That’s it, we’re done. So simple isn’t it?
If you are having trouble fixing this problem with the instructions above, but are being able to solve this problem with any another method please describe it in the comment section below. Thanks!
If this article has helped you solve the problem then please leave a comment
Thanks for reading!
Arthur is a designer and full stack software engineer. He is the founder of Space X-Chimp and the blog My Cyber Universe. His personal website can be found at arthurgareginyan.com.