ruby,

Solution: cannot load such file -- webrick (LoadError)

Nov 03, 2021 · 1 min read · Post a comment

As a DevOps engineer myself and three years of using a MacBook Pro, I’ve noticed that updating a major release of macOS always comes with unwelcomed ruby dependencies and version errors.

My first on the list is cannot load such file -- webrick (LoadError). The error usually occurs when trying to execute jekyll serve and the reason for it, is a missing gem, which in this case it’s webrick.

Prerequisites

  • Ruby environment

Solution

Step 1. Add the missing gem webrick manually using the Ruby Dependency Management called bundle.

bundle add webrick

Conclusion

The solution was pretty simple and easy, and if it still doesn’t work for you, please let me know.

Related Ruby issues:

Feel free to leave a comment below and if you find this tutorial useful, follow our official channel on Telegram.