Jekyll 服务不打开端口

Jekyll serve doesn't open a port

我最近在遇到很多麻烦之后安装了 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.
                    ------------------------------------------------

它没有打开一个端口。 我试了运行ning 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)>'

我也试过 运行ning 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 运行?

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

jekyll serve --port 4001