首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Jekyll和Nokogiri安装问题

Jekyll和Nokogiri安装问题
EN

Stack Overflow用户
提问于 2019-03-02 12:54:25
回答 1查看 557关注 0票数 2

我在Windows上使用ubuntu 18.04.2 LTS,我有一个基本的问题。我的目标是使用github模板https://github.com/github/personal-website并将其发布到username.github.io

我对第四步有个问题:

构建站点并使其在本地服务器上可用

代码语言:javascript
复制
bundle exec jekyll serve
代码语言:javascript
复制
hafidz@LAMBDA05:~/personal-website$ bundle exec jekyll serve
**Could not find nokogiri-1.10.1 in any of the sources**
Run `bundle install` to install missing gems.

安装bundle,jekyll和nokogori已经是一个变通的方法了,但我想已经完成了。它需要路径设置吗?

代码语言:javascript
复制
hafidz@LAMBDA05:~/personal-website$ bundle -v
Bundler version 2.0.1
hafidz@LAMBDA05:~/personal-website$ jekyll -v
Traceback (most recent call last):
        12: from /usr/local/bin/jekyll:23:in `<main>'
        11: from /usr/local/bin/jekyll:23:in `load'
        10: from /var/lib/gems/2.5.0/gems/jekyll-3.8.5/exe/jekyll:11:in `<top (required)>'
         9: from /var/lib/gems/2.5.0/gems/jekyll-3.8.5/lib/jekyll/plugin_manager.rb:50:in `require_from_bundler'
         8: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler.rb:107:in `setup'
         7: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:20:in `setup'
         6: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/runtime.rb:108:in `block in definition_method'
         5: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/definition.rb:226:in `requested_specs'
         4: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/definition.rb:237:in `specs_for'
         3: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/definition.rb:170:in `specs'
         2: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/spec_set.rb:81:in `materialize'
         1: from /var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/spec_set.rb:81:in `map!'
/var/lib/gems/2.5.0/gems/bundler-2.0.1/lib/bundler/spec_set.rb:87:in `block in materialize': Could not find nokogiri-1.10.1 in any of the sources (Bundler::GemNotFound)
hafidz@LAMBDA05:~/personal-website$ nokogiri -v
# Nokogiri (1.10.1)
    ---
    warnings: []
    nokogiri: 1.10.1
    ruby:
      version: 2.5.3
      platform: x86_64-linux-gnu
      description: ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux-gnu]
      engine: ruby
    libxml:
      binding: extension
      source: packaged
      libxml2_path: "/var/lib/gems/2.5.0/gems/nokogiri-1.10.1/ports/x86_64-pc-linux-gnu/libxml2/2.9.9"
      libxslt_path: "/var/lib/gems/2.5.0/gems/nokogiri-1.10.1/ports/x86_64-pc-linux-gnu/libxslt/1.1.33"
      libxml2_patches:
      - 0001-Revert-Do-not-URI-escape-in-server-side-includes.patch
      libxslt_patches: []
      compiled: 2.9.9
      loaded: 2.9.9

欣赏有帮助

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-04-11 05:21:31

我在使用Ubuntu WSL时看到了类似的情况。我一直在关注Jekyll WSL instructions,然后被卡住了。在Dave Rupert的博客(link)上有一个很好的提示,推荐了以下内容,并解除了我的屏蔽:apt install zlibc zlib1g-dev libxml2 libxml2-dev libxslt1.1 libxslt1-dev

下面是我的会话的bash历史记录:

代码语言:javascript
复制
   24  sudo apt install ruby
   26  gem update jekyll
   27  code .
   28  sudo apt-get update -y && sudo apt-get upgrade -y
   30  sudo gem update
   31  sudo apt-add-repository ppa:brightbox/ruby-ng
   32  sudo apt-get update
   33  sudo apt-get install ruby2.5 ruby2.5-dev build-essential dh-autoreconf
   35  sudo gem update
   37  sudo gem install jekyll bundler
   38  jekyll -v
   40  sudo bundle update
   45  sudo bundle install
   47  sudo apt install zlibc zlib1g-dev libxml2 libxml2-dev libxslt1.1 libxslt1-dev
   48  sudo gem install nokogiri -v '1.8.2' --source 'https://rubygems.org/'
   49  sudo bundle install
   51  bundle exec jekyll -v
   52  bundle exec jekyll serve
   54  sudo bundle update
   56  bundle exec jekyll serve
   57  history
   58  history > history.txt
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/54955369

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档