Home jekyll serve 실행 시 in require': cannot load such file -- webrick (LoadError)가 발생하는 경우 해결 방법
Post
Cancel
Preview Image

jekyll serve 실행 시 in require': cannot load such file -- webrick (LoadError)가 발생하는 경우 해결 방법

오랜만에 새로이 지금 블로그를 로컬에서 빌드해보려고 bundle exec jekyll serve를 실행하던 찰나에, 다음과 같은 에러가 발생했다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$ bundle exec jekyll serve
Configuration file: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io/_config.yml
 Theme Config file: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io/_config.yml
            Source: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io
       Destination: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 7.962 seconds.
 Auto-regeneration: enabled for '/Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io'
                    ------------------------------------------------
      Jekyll 4.2.0   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------
/Users/bossm0n5t3r/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `require': cannot load such file -- webrick (LoadError)
	from /Users/bossm0n5t3r/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
	from /Users/bossm0n5t3r/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
	from /Users/bossm0n5t3r/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
	from /Users/bossm0n5t3r/.rbenv/versions/3.0.3/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:100:in `process'
  ...

그리고 현재 내가 설정한 rubygem의 버전은 아래와 같다.

1
2
3
4
5
$ ruby --version
ruby 3.0.3p157 (2021-11-24 revision 3fb7d2cadc) [arm64-darwin21]

$ gem --version
3.2.32

도대체 왜 발생한걸까 궁금해서 찾던 도중 Jekyll serve fails on Ruby 3.0 PR을 보게 되었고, 필요한 webrick 을 설치해줘서 해결하였다.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
$ bundle add webrick
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
...

$ bundle exec jekyll serve
Configuration file: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io/_config.yml
 Theme Config file: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io/_config.yml
            Source: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io
       Destination: /Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
                    done in 6.984 seconds.
 Auto-regeneration: enabled for '/Users/bossm0n5t3r/gitFolders/bossm0n5t3r.github.io'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

References

This post is licensed under CC BY 4.0 by the author.

문자열은 어떤 언어에서도 불변할까?

macOS Monterey에서 처음 부팅한 후, 터미널 실행 시 느려짐 해결 방법