Bundle Exec Jekyll Serve: Cannot Load Such File

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.

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.

jekyll serve isn't working for dependency error

The reason I asked you to post the output from bundle show is to assess if all the dependencies have been installed successfully.

If you go through the first error output, you'll see the following:

The full error message from Ruby is: 'cannot load such file -- ruby_dep/warning'

This means that the gem ruby_dep did not install properly. (ruby_dep is a second-order dependency of jekyll-watch)

So, the question here is,

    "Where you able to finish bundle install completely without any errors?"

If no, you probably need to install the Ruby Devkit for your Ruby version by running the following:

$ ridk install

Error while locally launching GitHub pages Jekyll page

This is a known issue with ruby 3 not having webrick by default anymore.

The good news are the issue has already been fixed and it's available from Jekyll 4.2.1.

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.

Jekyll Serve not working

I was able to solve it using gem cleanup followed by bundle exec jekyll serve.



Related Topics



Leave a reply



Submit