1

I am a novice programmer trying to use a Jekyll theme for my Github blog. This is my first time using it... and I'm having problems with bundle exec jekyll serve command. (FYI, I'm using Windows OS.)

Here's the output:

C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `require': cannot load such file -- rexml/parsers/baseparser (LoadError)
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `<top (required)>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `require'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `<top (required)>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `require'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `<top (required)>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `require'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `<class:Kramdown>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:60:in `<module:Parser>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:19:in `<module:Kramdown>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:17:in `<top (required)>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll/converters/smartypants.rb:3:in `require'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll/converters/smartypants.rb:3:in `<top (required)>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:13:in `require'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:13:in `block in require_all'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:12:in `each'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:12:in `require_all'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/lib/jekyll.rb:194:in `<top (required)>'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/exe/jekyll:8:in `require'
    from C:/Ruby30-x64/lib/ruby/gems/3.0.0/gems/jekyll-3.8.6/exe/jekyll:8:in `<top (required)>'
    from C:/Ruby30-x64/bin/jekyll:25:in `load'
    from C:/Ruby30-x64/bin/jekyll:25:in `<main>'

I tried these 4 different solutions:

1.

bundle add webrick

But had the same error

  1. (referenced bundle exec jekyll serve: cannot load such file)
gem install jekyll github-pages
gem install jekyll
gem install jekyll-feed
bundle update

But had the same error

3.

gem install webrick
gem install jekyll -mentions

Then added

group :jekyll_plugins do
  gem "jekyll-mentions", "1.6.0"
  gem "webrick"
end

to my gemfile, then

bundle install

But had the same error

  1. (referenced https://github.com/jekyll/jekyll/issues/8523)
bundle add sdbm
bundle add webrick
bundle add net-telnet
bundle add xmlrpc

But had the same error.

Is there any way I can fix this situation?

torek
  • 448,244
  • 59
  • 642
  • 775
szv
  • 13
  • 2

1 Answers1

7

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.

hmdne
  • 434
  • 2
  • 5
  • Thank you for your kind answer, and thanks to you, I could get pass the LoadError! However now I am facing an Argument Error that looks like this: "rb_delegate: wrong number of arguments (given 2, expected 1) (ArgumentError)"; Trying to fix this for days but I'm still stuck with the problem. I wonder if you have any ideas for this? – szv Jan 31 '22 at 07:25
  • Not really. But I would recommend you to start a new question :) – hmdne Feb 06 '22 at 00:58