Error in fresh jekyll installation

I get an error trying to run bundle exec jekyll serve on linux on a fresh blog. I ran:

$ jekyll new myblog
$ cd myblog/
$ bundle add webrick
$ bundle exec jekyll serve

The final command throws the error:

bundler: failed to load command: jekyll (/home/isaac/gems/bin/jekyll)
/usr/lib/ruby/vendor_ruby/jekyll/converters/scss.rb:3:in `require': cannot load such file -- sass (LoadError)
	from /usr/lib/ruby/vendor_ruby/jekyll/converters/scss.rb:3:in `<top (required)>'
	from /usr/lib/ruby/vendor_ruby/jekyll-sass-converter.rb:4:in `require'
	from /usr/lib/ruby/vendor_ruby/jekyll-sass-converter.rb:4:in `<top (required)>'
	from /home/isaac/gems/gems/jekyll-4.2.2/lib/jekyll.rb:195:in `require'
	from /home/isaac/gems/gems/jekyll-4.2.2/lib/jekyll.rb:195:in `<top (required)>'
	from /home/isaac/gems/gems/jekyll-4.2.2/exe/jekyll:8:in `require'
	from /home/isaac/gems/gems/jekyll-4.2.2/exe/jekyll:8:in `<top (required)>'
	from /home/isaac/gems/bin/jekyll:25:in `load'
	from /home/isaac/gems/bin/jekyll:25:in `<top (required)>'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `load'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/cli/exec.rb:23:in `run'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/cli.rb:486:in `exec'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/cli.rb:31:in `dispatch'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/cli.rb:25:in `start'
	from /home/isaac/gems/gems/bundler-2.3.22/exe/bundle:48:in `block in <top (required)>'
	from /home/isaac/gems/gems/bundler-2.3.22/lib/bundler/friendly_errors.rb:120:in `with_friendly_errors'
	from /home/isaac/gems/gems/bundler-2.3.22/exe/bundle:36:in `<top (required)>'
	from /home/isaac/gems/bin/bundle:25:in `load'
	from /home/isaac/gems/bin/bundle:25:in `<main>'

My versions are:

$ ruby -v
ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [x86_64-linux-gnu]
$ gem -v
3.3.5
$ jekyll -v
jekyll 4.2.2
$ bundle -v
Bundler version 2.3.22

Please let me know whether other information would be helpful.

Try running:

bundle install
bundle update
bundle exec jekyll serve --livereload

If that does not work and you happen to have this up on a public repo, please share the link.

I’m not a ruby expert but when I see there are 2 different paths to ruby stuff the user usually ends up having 2 different ruby installations and it cannot run properly. Its possible what you have is correct, but my guess is you need to uninstall ruby and re-install it.

1 Like

I uninstalled and reinstalled ruby and that cured the problem. Thanks for your help!