Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/tfs/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jekyll 无法在本地运行github页面_Jekyll_Github Pages - Fatal编程技术网

Jekyll 无法在本地运行github页面

Jekyll 无法在本地运行github页面,jekyll,github-pages,Jekyll,Github Pages,我试图在macOS上本地运行一个基本的GitHub页面 这是我的档案: $cat Gemfile source 'https://rubygems.org' gem 'github-pages', group: :jekyll_plugins 然后安装依赖项: $bundle install --path vendor/bundle 因此,它安装了Jekyll3.8.5。 但是,当我使用bundle exec jekyll build--verbose构建站点时,我会遇到下一个错误: L

我试图在macOS上本地运行一个基本的GitHub页面

这是我的档案:

$cat Gemfile
source 'https://rubygems.org'
gem 'github-pages', group: :jekyll_plugins
然后安装依赖项:

$bundle install --path vendor/bundle
因此,它安装了Jekyll3.8.5。 但是,当我使用
bundle exec jekyll build--verbose构建站点时,我会遇到下一个错误:

  Logging at level: debug
Configuration file: /Users/user/personal/my_user_name.github.io/_config.yml
             Theme: jekyll-theme-midnight
      Theme source: /Users/user/personal/my_user_name.github.io/vendor/bundle/ruby/2.6.0/gems/jekyll-theme-midnight-0.1.1
Invalid theme folder: _includes
      GitHub Pages: github-pages v203
      GitHub Pages: jekyll v3.8.5
             Theme: jekyll-theme-midnight
      Theme source: /Users/user/personal/my_user_name.github.io/vendor/bundle/ruby/2.6.0/gems/jekyll-theme-midnight-0.1.1
Invalid theme folder: _includes
         Requiring: jekyll-seo-tag
         Requiring: jekyll-coffeescript
         Requiring: jekyll-commonmark-ghpages
         Requiring: jekyll-gist
jekyll 3.8.5 | Error:  uninitialized constant Faraday::Error::ClientError
Did you mean?  Faraday::ClientError
我的机器详细信息:

$sw_vers
ProductName:    Mac OS X
ProductVersion: 10.15.2
BuildVersion:   19C57
我如何解决这个问题

附言。 如果我用

$jekyll new myblog
$cd myblog
$jekyll serve
它运行正常。我看到的唯一区别是它使用了Jekyll4.0.0

更新: 我已将文件更改为:

$cat Gemfile
source 'https://rubygems.org'
#gem 'github-pages', group: :jekyll_plugins
gem 'github-pages'
运行
bundle exec-jekyll-service--verbose
后,我看到:

  Logging at level: debug
Configuration file: /Users/user/personal/my_user_name.github.io/_config.yml
  Logging at level: debug
             Theme: jekyll-theme-midnight
      Theme source: /Users/user/personal/my_user_name.github.io/vendor/bundle/ruby/2.6.0/gems/jekyll-theme-midnight-0.1.1
Invalid theme folder: _includes
         Requiring: jekyll-seo-tag
            Source: /Users/user/personal/my_user_name.github.io
       Destination: /Users/user/personal/my_user_name.github.io/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       EntryFilter: excluded /Gemfile
       EntryFilter: excluded /Gemfile.lock
       EntryFilter: excluded /vendor/bundle/ruby
         Rendering: assets/css/style.scss
  Pre-Render Hooks: assets/css/style.scss
  Rendering Markup: assets/css/style.scss
           Writing: /Users/user/personal/my_user_name.github.io/_site/assets/css/style.css
                    done in 0.099 seconds.
         Requiring: jekyll-watch
           Watcher: Ignoring (?-mix:^_config\.yml)
           Watcher: Ignoring (?-mix:^_site\/)
           Watcher: Ignoring (?-mix:^Gemfile)
           Watcher: Ignoring (?-mix:^Gemfile\.lock)
           Watcher: Ignoring (?-mix:^vendor\/bundle\/)
 Auto-regeneration: enabled for '/Users/user/personal/my_user_name.github.io'
[2020-01-01 17:52:58] INFO  WEBrick 1.4.2
[2020-01-01 17:52:58] INFO  ruby 2.6.5 (2019-10-01) [x86_64-darwin19]
[2020-01-01 17:52:58] DEBUG WEBrick::HTTPServlet::FileHandler is mounted on /.
[2020-01-01 17:52:58] DEBUG unmount .
[2020-01-01 17:52:58] DEBUG Jekyll::Commands::Serve::Servlet is mounted on .
    Server address: http://127.0.0.1:4000
[2020-01-01 17:52:58] INFO  WEBrick::HTTPServer#start: pid=65841 port=4000
  Server running... press ctrl-c to stop.
[2020-01-01 17:53:27] DEBUG accept: 127.0.0.1:53546
[2020-01-01 17:53:27] DEBUG accept: 127.0.0.1:53547
[2020-01-01 17:53:27] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:30] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:31] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:34] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:35] DEBUG Jekyll::Commands::Serve::Servlet is invoked.
[2020-01-01 17:53:42] DEBUG close: 127.0.0.1:53547
^C[2020-01-01 17:53:55] DEBUG close TCPSocket(127.0.0.1, 4000)
[2020-01-01 17:53:55] INFO  going to shutdown ...
[2020-01-01 17:53:56] DEBUG close: 127.0.0.1:53546
[2020-01-01 17:53:56] INFO  WEBrick::HTTPServer#start done.

但当我在浏览器中打开它时,我看到的只是一个目录列表,而不是博客

,它看起来是由于法拉第的最新更新——一个由github页面依赖的宝石

暂时尝试此解决方法

  • 将以下行添加到您的文件中

    宝石“法拉第”,“~>0”

  • 使用命令
    bundle update
    使用gem文件更新gem

    您可能会看到以下输出:

    获取法拉第0.17.3(是1.0.0)
    安装法拉第0.17.3(WAS1.0.0)

    这意味着./vendor/bundle中的gem faraday已更新为与github页面兼容的最新版本

    您可以在查看法拉第的版本历史记录

  • 请重试
    bundle exec jekyll

  • 如果它还不起作用,请尝试
    bundle pristine