관리 메뉴

준호씨의 블로그

jekyll 실행 시킬 때 `require': cannot load such file -- webrick (LoadError) 오류가 난다면 bundle add webrick 본문

개발이야기

jekyll 실행 시킬 때 `require': cannot load such file -- webrick (LoadError) 오류가 난다면 bundle add webrick

준호씨 2021. 3. 6. 00:05
반응형

bundle exec jekyll serve로 로컬에서 jekyll 서버를 구동하려고 하면 webrick을 로드하지 못했다는 오류가 발생할 수 있습니다.

$ bundle exec jekyll serve
Configuration file: /Users/junho85/WebstormProjects/junho85.github.io/_config.yml
            Source: /Users/junho85/WebstormProjects/junho85.github.io
       Destination: /Users/junho85/WebstormProjects/junho85.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.441 seconds.
 Auto-regeneration: enabled for '/Users/junho85/WebstormProjects/junho85.github.io'
                    ------------------------------------------------
      Jekyll 4.2.0   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
/usr/local/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 /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/servlet.rb:3:in `<top (required)>'
        from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `require_relative'
        from /usr/local/lib/ruby/gems/3.0.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:179:in `setup'
...

이런 경우 bundle add webrick으로 webrick을 추가해 주고 다시 실행하면 됩니다.

$ bundle add webrick
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bundler 2.2.13
Using colorator 1.1.0
Using concurrent-ruby 1.1.8
...
Using terminal-table 2.0.0
Using jekyll 4.2.0
Using jekyll-feed 0.15.1
Using jekyll-seo-tag 2.7.1
Using minima 2.5.1
Bundle complete! 6 Gemfile dependencies, 31 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

$ bundle exec jekyll serve --port 4001
Configuration file: /Users/junho85/WebstormProjects/junho85.github.io/_config.yml
            Source: /Users/junho85/WebstormProjects/junho85.github.io
       Destination: /Users/junho85/WebstormProjects/junho85.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.295 seconds.
 Auto-regeneration: enabled for '/Users/junho85/WebstormProjects/junho85.github.io'
    Server address: http://127.0.0.1:4001/
  Server running... press ctrl-c to stop.
[2021-03-05 12:14:42] ERROR `/favicon.ico' not found.

 

이유는 ruby 3.0.0부터 webrick이 기본으로 포함된 gem에서 빠졌기 때문입니다.

참고: github.com/jekyll/jekyll/issues/8523

 

Jekyll serve fails on Ruby 3.0 · Issue #8523 · jekyll/jekyll

My Environment Software Version(s) Operating System Ubuntu 20.04 Ruby 3.0.0 jekyll 4.2.0 github-pages No Expected Behaviour bundle exec jekyll serve runs on Ruby 3.0. Current Behavior bundle exec j...

github.com

www.ruby-lang.org/en/news/2020/12/25/ruby-3-0-0-released/

 

Ruby 3.0.0 Released

Posted by naruse on 25 Dec 2020 We are pleased to announce the release of Ruby 3.0.0. From 2015 we developed hard toward Ruby 3, whose goal is performance, concurrency, and Typing. Especially about performance, Matz stated “Ruby3 will be 3 times faster t

www.ruby-lang.org

반응형
0 Comments
댓글쓰기 폼