Jekyll发球没有打开港口

时间:2020-08-13 01:20:36

标签: ruby rubygems jekyll

在遇到很多麻烦之后,我最近安装了Jekyll,当我运行bundle exec jekyll serve时,输出如下:

    Configuration file: /Users/Michelle/Desktop/hacked-by-chel/_config.yml
            Source: /Users/Michelle/Desktop/hacked-by-chel
       Destination: /Users/Michelle/Desktop/hacked-by-chel/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 1.12 seconds.
 Auto-regeneration: enabled for '/Users/Michelle/Desktop/hacked-by-chel'
                    ------------------------------------------------
      Jekyll 4.1.1   Please append `--trace` to the `serve` command
                     for any additional information or backtrace.
                    ------------------------------------------------

它没有打开端口。 我尝试运行bundle exec jekyll serve --trace,输出为

Michelle@Michelles-MacBook-Pro hacked-by-chel % bundle exec jekyll serve --trace
Configuration file: /Users/Michelle/Desktop/hacked-by-chel/_config.yml
            Source: /Users/Michelle/Desktop/hacked-by-chel
       Destination: /Users/Michelle/Desktop/hacked-by-chel/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating feed for posts
                    done in 0.948 seconds.
 Auto-regeneration: enabled for '/Users/Michelle/Desktop/hacked-by-chel'
bundler: failed to load command: jekyll (/usr/local/bin/jekyll)
Errno::EADDRINUSE: Address already in use - bind(2) for 127.0.0.1:4000
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:201:in `bind'

  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:201:in `listen'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:764:in `block in tcp_server_
sockets'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:227:in `each'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:227:in `foreach'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/socket.rb:762:in `tcp_server_sockets'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/webrick/utils.rb:65:in `create_listene
rs'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/webrick/server.rb:127:in `listen'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/webrick/server.rb:108:in `initialize'
  /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/webrick/httpserver.rb:47:in `initializ
e'
/Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/commands/serve.rb:215:in `new'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/commands/serve.rb:215:in `start_up_webrick'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/commands/serve.rb:102:in `process'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `each'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_pro
gram'

  /Users/Michelle/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
  /Users/Michelle/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
  /Users/Michelle/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
  /Users/Michelle/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
  /Users/Michelle/.gem/ruby/2.6.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
  /Library/Ruby/Gems/2.6.0/gems/jekyll-4.1.1/exe/jekyll:15:in `<top (required)>'
  /usr/local/bin/jekyll:23:in `load'
  /usr/local/bin/jekyll:23:in `<top (required)>'

我还尝试运行jekyll --version,它说

The dependency tzinfo (~> 1.2) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby
 but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32, java. To add those platforms to the bundle, run `bundle
lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32 java`.
The dependency tzinfo-data (>= 0) will be unused by any of the platforms Bundler is installing for. Bundler is installing for r
uby but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32, java. To add those platforms to the bundle, run `bund
le lock --add-platform x86-mingw32 x64-mingw32 x86-mswin32 java`.
The dependency wdm (~> 0.1.1) will be unused by any of the platforms Bundler is installing for. Bundler is installing for ruby
but the dependency is only for x86-mingw32, x64-mingw32, x86-mswin32. To add those platforms to the bundle, run `bundle lock --
add-platform x86-mingw32 x64-mingw32 x86-mswin32`.
jekyll 4.1.1

我如何让Jekyll运行?

1 个答案:

答案 0 :(得分:2)

Address already in use - bind(2) for 127.0.0.1:4000检查是否有使用该端口或其他端口的进程:

jekyll serve --port 4001