Cannot Build Site

Hey there. I’m trying to use Jekyll for the first time. Everything is installed, running MacOS Sonoma 14.1.1 and using Homebrew for Ruby. I can see my current Ruby and Jekyll versions. (3.4.1 and 4.3.4 respectively.) I set up my first site and I’m ready to run bundle exec jekyll serve but every time I do, no matter what solutions I try, I get the same error: bundler: failed to load command: jekyll. The Gemfile is the standard Gemfile that comes with every new Jekyll site. I have not altered it.

Here’s the full response when I run bundle exec jekyll serve:

/opt/homebrew/lib/ruby/gems/3.4.0/gems/jekyll-4.3.4/lib/jekyll.rb:26: warning: logger was loaded from the standard library, but will no longer be part of the default gems starting from Ruby 3.5.0.
You can add logger to your Gemfile or gemspec to silence this warning.
/opt/homebrew/lib/ruby/gems/3.4.0/gems/jekyll-4.3.4/lib/jekyll.rb:28: warning: csv was loaded from the standard library, but is not part of the default gems starting from Ruby 3.4.0.
You can add csv to your Gemfile or gemspec to silence this warning.
bundler: failed to load command: jekyll (/opt/homebrew/lib/ruby/gems/3.4.0/bin/jekyll)
/opt/homebrew/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require': cannot load such file -- csv (LoadError)
        from /opt/homebrew/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/jekyll-4.3.4/lib/jekyll.rb:28:in '<top (required)>'
        from /opt/homebrew/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'Kernel.require'
        from /opt/homebrew/Cellar/ruby/3.4.1/lib/ruby/3.4.0/bundled_gems.rb:82:in 'block (2 levels) in Kernel#replace_require'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/jekyll-4.3.4/exe/jekyll:8:in '<top (required)>'
        from /opt/homebrew/lib/ruby/gems/3.4.0/bin/jekyll:25:in 'Kernel#load'
        from /opt/homebrew/lib/ruby/gems/3.4.0/bin/jekyll:25:in '<top (required)>'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in 'Kernel.load'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:59:in 'Bundler::CLI::Exec#kernel_load'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/cli/exec.rb:23:in 'Bundler::CLI::Exec#run'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/cli.rb:452:in 'Bundler::CLI#exec'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/command.rb:28:in 'Bundler::Thor::Command#run'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in 'Bundler::Thor::Invocation#invoke_command'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor.rb:538:in 'Bundler::Thor.dispatch'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/cli.rb:35:in 'Bundler::CLI.dispatch'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/vendor/thor/lib/thor/base.rb:584:in 'Bundler::Thor::Base::ClassMethods#start'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/cli.rb:29:in 'Bundler::CLI.start'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/exe/bundle:28:in 'block in <top (required)>'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/lib/bundler/friendly_errors.rb:117:in 'Bundler.with_friendly_errors'
        from /opt/homebrew/lib/ruby/gems/3.4.0/gems/bundler-2.6.3/exe/bundle:20:in '<top (required)>'
        from /opt/homebrew/opt/ruby/bin/bundle:25:in 'Kernel#load'
        from /opt/homebrew/opt/ruby/bin/bundle:25:in '<main>'

I have tried many different solutions. I have uninstalled and reinstalled some gems. I have attempted to add webrick but that didn’t do anything. Adding CSV did not change anything. Trying bundle add jekyll gives me a warning about duplicate gems. Any advice is appreciated. Thank you.

Hi, I have the same problem. You can try delete ‘Gemfile.lock’ in your website, and use jekyll serve again. I have solved the problem.

Try running bundle install before the bundle exec jekyll serve.

Unfortunately, that did not work for me. But I appreciate it :slight_smile:

Nope, same error unfortunately. :frowning: But thank you lol

it kinda looks like you have ruby installed twice - 3.4.0 and 3.4.1 and half the stuff is in one in the rest in the other. See if you can tell if that is true and uninstall and reinstall if possible. Might want to see if you are using ruby for anything else.

image

I’ve been struggling with the same issue. Finally I gave in and explicitly installed the libraries that the warning is about, using

bundle add <library name here>

Do that for both csv and logger. See if bundle exec jekyll serve gives you more of these warnings (which clearly aren’t warnings). I had to get another 3 I think.

After all are added, it seems to be working!