Untaint, kramdown, failed to load errors

Hi all,
I have this issue every time I try to clone a gh-pages directory and run Jekyll. Versions of Ruby seem to conflict. Or Bundler. Or Kramdown. I do suggested actions, e.g. try to run a different version of Ruby, re-run bundle update, add gem "webrick", "~> 1.7" to gemfile.

I am not totally inexperienced with github or Jekyll; sometimes I know I have managed to fix the issue, but then a year goes by and I forget how I did it!

Right now, I have this error message (along with many other lines):
bundler: failed to load command: jekyll

I am running:
ruby 3.1.2p20

I think a big problem is that I just don’t get what where when how and why Ruby.
Any idea what I am doing wrong or where I should look for help?

Thanks!

can you post the full output of what you get including what command you used? the clues are sometimes buried in the other lines.

Most common thing I see is ruby installed more than once and some things it needs are installed in one directory and other things in another and ruby can’t get both at the same time? something like that. You can see this when looking at the paths in the error messages…

Also post what OS you are on.

1 Like

The current dependencies for Github Pages are: Dependency versions | GitHub Pages

In particular, note that Ruby 2 and Jekyll 3 are required.

1 Like

Thank you - yes, I know I have installed ruby more than once.

When I run
´$ bundle exec jekyll serve´

This is the output:


mark@Marks-MBP-2 dbsite % bundle exec jekyll serve
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:29: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:35: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:44: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/bundler-1.17.3/lib/bundler/shared_helpers.rb:118: warning: Pathname#untaint is deprecated and will be removed in Ruby 3.2.
bundler: failed to load command: jekyll (/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll)
LoadError: cannot load such file -- rexml/parsers/baseparser
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `<class:Kramdown>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:60:in `<module:Parser>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:19:in `<module:Kramdown>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:17:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll/converters/smartypants.rb:3:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll/converters/smartypants.rb:3:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:13:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:13:in `block in require_all'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:12:in `each'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:12:in `require_all'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:194:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/exe/jekyll:8:in `require'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/exe/jekyll:8:in `<top (required)>'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `load'
  /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `<top (required)>'

I am on macOS Monterey 12.6

Many thanks!

Ok, Thanks. I will see haw far I get with that. I appreciate just having a starting point - so thanks very much!

did you already do bundle install? or is it bundle install jekyll?

if you are just running locally I am pretty sure the latest version of jekyll will work with jekyll but not sure about 3.8.7 which you have.

I did bundle install, which runs fine.

I no longer have that untaint is deprecated message with bundle exec jekyll serve. But there are still many others:
`

/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `require': **cannot load such file -- rexml/parsers/baseparser (****LoadError****)**

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `require'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `require'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `require'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `<class:Kramdown>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:60:in `<module:Parser>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:19:in `<module:Kramdown>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:17:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll/converters/smartypants.rb:3:in `require'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll/converters/smartypants.rb:3:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:13:in `require'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:13:in `block in require_all'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:12:in `each'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:12:in `require_all'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:194:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/exe/jekyll:8:in `require'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/exe/jekyll:8:in `<top (required)>'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `load'

from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `<top (required)>'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `load'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/cli/exec.rb:23:in `run'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/cli.rb:483:in `exec'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/cli.rb:31:in `dispatch'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/cli.rb:25:in `start'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/gems/3.1.0/gems/bundler-2.3.11/exe/bundle:48:in `block in <top (required)>'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/3.1.0/bundler/friendly_errors.rb:103:in `with_friendly_errors'

from /usr/local/Cellar/ruby/3.1.2_1/lib/ruby/gems/3.1.0/gems/bundler-2.3.11/exe/bundle:36:in `<top (required)>'

from /usr/local/lib/ruby/gems/3.1.0/bin/bundle:25:in `load'

from /usr/local/lib/ruby/gems/3.1.0/bin/bundle:25:in `<main>'

Any thoughts?

see how one path says Users/mark and the other is usr/local? I take this to mean that you have multiple ruby installations and the different pieces needed to run jekyll are installed in different places but can’t run together? I’m no ruby expert and not a mac person either but this seems to be similar to lots of other issues where the solution was to uninstall and reinstall ruby.

I would uninstall ruby, then make sure it isn’t there any more on those paths and the re-install (make sure it has the devkit).

1 Like

Super. Thanks. I will look into how to do that. I suspected something like was going on, but didn’t know how to tell for sure.

Thanks very much :slight_smile:

Thanks again for the hint.

I think I had lots of issues that needed cleaning up. This site helped me a lot:

I uninstalled and reinstalled Ruby with a version manager, asdf.

But I still have a problem here. Can you help me see what it is?

Thanks in advance

bundler: failed to load command: jekyll (/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll)
/Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `require': cannot load such file -- rexml/parsers/baseparser (LoadError)
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/html.rb:10:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `require'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/html.rb:10:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `require'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown/paragraph.rb:14:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `require'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:345:in `<class:Kramdown>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:60:in `<module:Parser>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:19:in `<module:Kramdown>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/kramdown-1.17.0/lib/kramdown/parser/kramdown.rb:17:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll/converters/smartypants.rb:3:in `require'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll/converters/smartypants.rb:3:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:13:in `require'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:13:in `block in require_all'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:12:in `each'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:12:in `require_all'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/lib/jekyll.rb:194:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/exe/jekyll:8:in `require'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/gems/jekyll-3.8.7/exe/jekyll:8:in `<top (required)>'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `load'
	from /Users/mark/Repos/dbsite/vendor/bundle/ruby/3.1.0/bin/jekyll:25:in `<top (required)>'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli/exec.rb:58:in `load'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli/exec.rb:58:in `kernel_load'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli/exec.rb:23:in `run'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:486:in `exec'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:31:in `dispatch'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/cli.rb:25:in `start'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/exe/bundle:48:in `block in <top (required)>'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/site_ruby/3.1.0/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /Users/mark/.asdf/installs/ruby/3.1.2/lib/ruby/gems/3.1.0/gems/bundler-2.3.25/exe/bundle:36:in `<top (required)>'
	from /Users/mark/.asdf/installs/ruby/3.1.2/bin/bundle:25:in `load'
	from /Users/mark/.asdf/installs/ruby/3.1.2/bin/bundle:25:in `<main>' ```

Downgrade The Ruby version will solve your problem.

1 Like

Ruby 2.7 would be a safer version to use, 3 seems to work on the latest jekyll but not sure about 3.8.7 that you are using.

try looking here- same error, maybe one of the fixes there will work.

1 Like

I see something there that looks promising … thank you : )

sorry, I missed this reply when it first came round . Thank you, you are correct!

It took some doing, but managed to get the earlier version of Ruby running. And it looks like I did that right, with Ruby 2.7 in the jekyll site folder, and Ruby 3 elsewhere.

And yeah, after bundle update, everything worked fine!

Thanks for your time and suggestions - I really appreciate it