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.
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
How to Access Current_User Object in Model
Can't Install Ruby via Rvm, Error Running '_Rvm_Make -J4' on Ubuntu 22.04
The Program 'Rails' Is Currently Not Installed
Minitest, Test::Unit, and Rails
Ruby on Rails: Creating a Model Entry with a Belongs_To Association
Convert Ip Address to 32 Bit Integer in Ruby
Autoload Paths and Nested Services Classes Crash in Ruby
Losing an Attribute When Saving Through an Association W/ Scope (Rails 4.0.0)
Sending Array of Values to a SQL Query in Ruby
Selenium2 Webdriver Ruby => How Click on a Hidden Link
Ruby Private Attr_Accessor and Unexpected Nil
Rails 7 Signup Form Doesn't Show Error Messages
How to Parse Xml Nodes to CSV with Ruby and Nokogiri
How to Access a Symbol Hash Key Using a Variable in Ruby
Why Is the << Operation on an Array in Ruby Not Atomic