# Cannot exec jekyll

**URL:** <https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434>\
**Category:** Help\
**Created:** [September 21, 2024, 8:36pm UTC](https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434 "2024-09-21T20:36:04Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![olirwin](https://avatars.discourse-cdn.com/v4/letter/o/2acd7d/32.png) [@olirwin](https://talk.jekyllrb.com/u/olirwin)\
**Post date:** [September 21, 2024, 8:36pm UTC](https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434/1 "2024-09-21T20:36:04Z")

</div>

I’m trying to update a website, but I’m running into an issue running the `bundle exec jekyll serve` command.

I get the following error:

```bash
bundler: failed to load command: jekyll (/home/user/.ruby/bin/jekyll)
<internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require': cannot load such file -- erb (LoadError)
Did you mean? drb
	from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from /home/user/.ruby/gems/jekyll-4.3.4/lib/jekyll/commands/new.rb:3:in `<top (required)>'
	from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from /home/user/.ruby/gems/jekyll-4.3.4/lib/jekyll.rb:13:in `block in require_all'
	from /home/user/.ruby/gems/jekyll-4.3.4/lib/jekyll.rb:12:in `each'
	from /home/user/.ruby/gems/jekyll-4.3.4/lib/jekyll.rb:12:in `require_all'
	from /home/user/.ruby/gems/jekyll-4.3.4/lib/jekyll.rb:188:in `<top (required)>'
	from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from <internal:/usr/lib/ruby/3.2.0/rubygems/core_ext/kernel_require.rb>:38:in `require'
	from /home/user/.ruby/gems/jekyll-4.3.4/exe/jekyll:8:in `<top (required)>'
	from /home/user/.ruby/bin/jekyll:25:in `load'
	from /home/user/.ruby/bin/jekyll:25:in `<top (required)>'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/cli/exec.rb:58:in `load'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/cli/exec.rb:58:in `kernel_load'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/cli/exec.rb:23:in `run'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/cli.rb:455:in `exec'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/vendor/thor/lib/thor/command.rb:28:in `run'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/vendor/thor/lib/thor.rb:527:in `dispatch'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/cli.rb:35:in `dispatch'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/vendor/thor/lib/thor/base.rb:584:in `start'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/cli.rb:29:in `start'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/exe/bundle:28:in `block in <top (required)>'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/lib/bundler/friendly_errors.rb:117:in `with_friendly_errors'
	from /home/user/.local/share/gem/ruby/3.2.0/gems/bundler-2.5.19/exe/bundle:20:in `<top (required)>'
	from /usr/local/bin/bundle:25:in `load'
	from /usr/local/bin/bundle:25:in `<main>'

```

I’m running ruby 3.2.5. Jekyll used to run with no issue. I have already tried a full reinstall of ruby and all gems to no avail.  
What am I missing? Even running `gem install erb` does not solve the issue.

---

<div class="post-metadata">

**Author:** ![rdyar](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/rdyar/32/710_2.png) [@rdyar](https://talk.jekyllrb.com/u/rdyar)\
**Post date:** [September 22, 2024, 4:54pm UTC](https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434/2 "2024-09-22T16:54:30Z")

</div>

fairly sure you have ruby (or some of the gems) installed twice - once in home/user and the other internally whatever that means. I think some systems come with a system ruby that sometimes causes issues when you then install ruby on your own.

I’d uninstall it and then see if it is still installed? I think there is also a `which ruby` command that may help?

---

<div class="post-metadata">

**Author:** ![Klerpson](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/klerpson/32/4344_2.png) [@Klerpson](https://talk.jekyllrb.com/u/Klerpson)\
**Post date:** [September 24, 2024, 2:47pm UTC](https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434/3 "2024-09-24T14:47:26Z")

</div>

Copy and paste it on GPT, and say you are not a programmer expert. So it will give you easy steps to get a solution.

---

<div class="post-metadata">

**Author:** ![christopolise](https://avatars.discourse-cdn.com/v4/letter/c/71c47a/32.png) [@christopolise](https://talk.jekyllrb.com/u/christopolise)\
**Post date:** [March 31, 2025, 4:25pm UTC](https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434/5 "2025-03-31T16:25:29Z")

</div>

@olirwin You could make sure that you have `bundler` and `jekyll` installed on your system. I ran across the same issue on my system and ended up having to install `ruby-erb` from the package manager. Hope this helps!

---

<div class="post-metadata">

**Author:** ![george-gca](https://yyz2.discourse-cdn.com/flex030/user_avatar/talk.jekyllrb.com/george-gca/32/5301_2.png) [@george-gca](https://talk.jekyllrb.com/u/george-gca)\
**Post date:** [April 2, 2025, 2:45pm UTC](https://talk.jekyllrb.com/t/cannot-exec-jekyll/9434/6 "2025-04-02T14:45:13Z")

</div>

My recommendation is

> [@Cannot Build Site](https://talk.jekyllrb.com/t/cannot-build-site/9663/12):
>
> The best recommendation I can give you is to use [devcontainers](https://containers.dev/supporting). You can see a simple working example in [this repository](https://github.com/levxyca/diciotech/blob/main/.devcontainer/devcontainer.json). Note that you must have [Docker](https://www.docker.com/products/docker-desktop/) installed for it to work. The main advantage is that it will create a docker container with all the dependencies installed inside, so you won’t need to worry about messing with your system installed packages. If you use [VSCode](https://code.visualstudio.com/), it is as simple as opening the main directory and letting it install everything for you. To test it, clone the reposito…
