7

尝试启动 Jekyll 服务器时出现以下错误

错误:未初始化的常量FFI::Platform::CPU

我尝试重新安装 Jekyll 服务器及其依赖项,但没有运气。有人可以帮我解决这个问题吗?谢谢。

我正在使用ubuntu=18.04jekyll=3.8.6

anil@anil:~/customer-churn$ jekyll serve


Configuration file:
  ~/customer-churn/_config.yml
  Source: ~/customer-churn
  Destination: ~/customer-churn/_site
  Incremental build: disabled. Enable with --incremental
Generating... done in 0.597 seconds.

jekyll 3.8.6 | 
Error:  uninitialized constant FFI::Platform::CPU
4

5 回答 5

11

I guess this problem occurs if you've installed Jekyll through apt. In that case a bundle update won't work immediately after an apt remove. Try the following approach:

Uninstall Jekyll first:

sudo apt remove jekyll*

Clean-up your dependency libs:

sudo apt autoremove

Then in your project directory run:

bundle update

Positively, then jekyll serve should work for you.

于 2020-01-11T22:16:53.210 回答
1

正如其他答案所建议的那样,我无法简单地通过bundle update使用 apt 运行或重新安装 jekyll 和依赖项来解决这个问题。

工作是为了

  • 删除所有版本的 jekyll 和依赖项sudo gem uninstall ...
  • 删除 jekyll 和所有依赖项apt-get remove ...
  • 然后重新安装 jekyll 和依赖项apt-get install ...
  • 然后bundle update在项目目录中运行。

然后只能bundle exec jekyll serve工作,并且jekyll build仍然会出现相同的错误。

于 2019-10-18T01:47:24.743 回答
1

我通过使用以下链接中给出的一些步骤重新安装 Jekyll 及其依赖项解决了这个问题 -

http://michaelchelen.net/81fa/install-jekyll-2-ubuntu-14-04/

我只想感谢所有在您百忙之中为我提供帮助和指导的人。

于 2019-07-19T08:50:02.403 回答
0

我遇到了同样的问题。运行后bundle exec jekyll serve --trace,我注意到一些包正在从/usr/lib/ruby/vendor_ruby目录中加载。所以,我删除了该/usr/lib/ruby/vendor_ruby目录(在我的主目录中保留它的备份副本,以防万一)。这之后bundle install,为我解决了这个问题。

于 2019-11-04T00:28:23.990 回答
0

尝试使用 apt 删除 Jekyll(如果你是这样安装的):

sudo apt remove jekyll*

然后进入你的项目,输入:

bundle update

只有这样:

jekyll serve

在这里找到了这个答案: https ://www.gitmemory.com/issue/jekyll/jekyll/7712/502572155

于 2019-08-16T15:32:50.107 回答