How to Run "Bundle Exec Jekyll New ."

bundle exec jekyll serve: cannot load such file

Here's how I solved it thanks to @choas' comment:

  1. Updated github-pages, jekyll and jekyll-feed gems by running gem install github-pages, gem install jekyll and gem install jekyll-feed. I had to do this step as a simple bundle update wasn't installing the latest version.
  2. Modify those gems in the Gemfile to the latest version.
  3. Run bundle update
  4. Finally run bundle exec jekyll serve

I am not sure that all those steps aren't redundant as I am not very familiar with Ruby/Github Pages/Jekyll but it did work.

Why must I run bundle exec jekyll serve after changing _includes to see changes?

The Jekyll reloader is only triggered by markdown changes. For changes to html or config you have to follow the _turn in off and on_ procedure.

bundle-exec-jekyll-serve causes LoadError

From what I understand, Ruby moves all stdlib parts into gems, some are "default gems", as in, they are normally installed with Ruby and don't need a reference in your Gemfile, but some are "bundled gems" which also are installed with Ruby, but need a reference in Gemfile. The problem stems from a fact, that with every Ruby release, some "default gems" become "bundled gems".

Such a situation happened with webrick in the past.

In your case it's most likely that you need rexml, which just became a "bundled gem" in Ruby 3.0: https://stdgems.org/rexml/

All this about a theory, but a solution is pretty simple. You just need to do

bundle add rexml

and then bundle install.

`bundle exec jekyll serve` dependences broke unexpectedly

Answering myself in case someone ends up here:

Using RVM solved the problem, but I had installed 3.0 instead of Ruby 2.7. This caused a different set of incompatibilities. Once I also added 2.7 and ran bundle install, bundle exec jekyll serve was able to start up properly.

I can serve a brand new Jekyll site, but I can't build it

You may be pleased to know that there's nothing wrong with your Ruby installation or the Jekyll version itself if bundle exec jekyll serve returns results as expected.

The sites generated by Jekyll are meant to be used with a server. That's the very reason the jekyll serve command exists.
jekyll serve first builds your site and then serves it on the browser via the WEBrick webserver.

Running bundle exec jekyll build will give you a production-ready site (in the _site directory by default). But it has to be hosted somewhere like GitHub Pages or Netlify or CloudCannon before you can navigate through the site.

For local browsing, bundle exec jekyll serve is the way.



Related Topics



Leave a reply



Submit