bundle exec jekyll serve: cannot load such file
Here's how I solved it thanks to @choas' comment:
- Updated github-pages, jekyll and jekyll-feed gems by running
gem install github-pages
,gem install jekyll
andgem install jekyll-feed
. I had to do this step as a simplebundle update
wasn't installing the latest version. - Modify those gems in the Gemfile to the latest version.
- Run
bundle update
- 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
Rails - How to Check for Online Users
Ruby Google_Drive Gem Oauth2 Saving
Scraping/Parsing Google Search Results in Ruby
Phonegap Mobile Rails Authentication (Devise? Authentication from Scratch)
Ruby Create Tar Ball in Chunks to Avoid Out of Memory Error
Rails Active Record: Find in Conjunction with :Order and :Group
Rspec 'Eq' VS 'Eql' in 'Expect' Tests
Pg::Invalidparametervalue: Error: Invalid Value for Parameter "Client_Min_Messages": "Panic"
Is There a Method to Limit/Clamp a Number
Making a Module Inherit from Another Module in Ruby
How to Specify a Read Timeout for a Net::Http::Post.New Request in Ruby 2
Documentation for Psych To_Yaml Options
Ruby Daemons and Jruby - Alternative Options