---
title: "jekyll : in `require': cannot load such file -- webrick (LoadError)"
author: "AVI"
date: "2023-06-20T16:58:46Z"
tags: []
categories: ["互联网"]
slug: "jekyll-in-require-cannot-load-such-file-webrick-loaderror"
draft: false
lastmod: "2023-06-20T17:47:43Z"
id: 2539356
url: "https://avi.iteye.com/blog/2539356"
---

在使用 JEKYLL 部署的过程中，使用 bundle exec jekyll serve 启动遇到以下错误：

 问题1：

```
bundler: failed to load command: jekyll, `require': cannot load such file -- webrick (LoadError) 
```

 

我的 Ruby 版本信息如下：

 

```
% ruby -v
ruby 3.2.2 (2023-03-30 revision e51014f9c0) [arm64-darwin22]
```

 

以前使用 MAC 默认的 Ruby 2.6 是可以加载的，当前工作区使用了 3.x 版本不行，Gemfile 文件中无法加载 webrick，需要将 webrick 加载到 gemfile 文件中再启动。

 

```
$ bundle add webrick
$ bundle install
$ bundle exec jekyll server
```

 

问题解决。

 

问题2：

 

```
.gem/ruby/3.2.2/gems/liquid-4.0.3/lib/liquid/variable.rb:124:in `taint_check': undefined method `tainted?' for "/":String (NoMethodError)

      return unless obj.tainted?
                       ^^^^^^^^^
```

 

 

 

这个与 liquid 的版本有关，官方说更新其依赖即可（需要 Ruby 3.x）。

 

 

```
% bundle update liquid
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Resolving dependencies...Fetching gem metadata from https://rubygems.org/............
% bundle exec jekyll serve
```