jekyll serve --livereload 失败并显示“无法加载 EventMachine C 扩展;要使用纯 ruby​​ 反应器,需要 'em/pure_ruby'”

问题描述

rubyinstaller 上给出的这个问题的解决方案对我不起作用

https://github.com/oneclick/rubyinstaller2/issues/96

gem uninstall eventmachine 
gem install eventmachine --platform ruby

有什么想法吗?

PS D:\wiecejwolnosci> jekyll new site2 .
Running bundle install in D:/wiecejwolnosci/site2... 
  Bundler: Fetching gem Metadata from https://rubygems.org/..........
  Bundler: Resolving dependencies...
  Bundler: Using public_suffix 4.0.6
  Bundler: Using addressable 2.7.0
  Bundler: Using bundler 2.2.12
  Bundler: Using colorator 1.1.0
  Bundler: Using concurrent-ruby 1.1.8
  Bundler: Using eventmachine 1.2.7 (x64-mingw32)
  Bundler: Using http_parser.rb 0.6.0
  Bundler: Using em-websocket 0.5.2
  Bundler: Using ffi 1.14.2 (x64-mingw32)
  Bundler: Using forwardable-extended 2.6.0
  Bundler: Using jekyll-sass-converter 2.1.0
  Bundler: Using rb-fsevent 0.10.4
  Bundler: Using rb-inotify 0.10.1
  Bundler: Using listen 3.4.1
  Bundler: Using jekyll-watch 2.2.1
  Bundler: Using rexml 3.2.4
  Bundler: Using kramdown 2.3.0
  Bundler: Using kramdown-parser-gfm 1.1.0
  Bundler: Using liquid 4.0.3
  Bundler: Using mercenary 0.4.0
  Bundler: Using pathutil 0.16.2
  Bundler: Using rouge 3.26.0
  Bundler: Using safe_yaml 1.0.5
  Bundler: Using unicode-display_width 1.7.0
  Bundler: Using terminal-table 2.0.0
  Bundler: Using jekyll 4.2.0
  Bundler: Using jekyll-Feed 0.15.1
  Bundler: Using minima 2.5.1
  Bundler: Using thread_safe 0.3.6
  Bundler: Using tzinfo 1.2.9
  Bundler: Using tzinfo-data 1.2021.1
  Bundler: Using wdm 0.1.1
  Bundler: Bundle complete! 6 Gemfile dependencies,35 gems Now installed.
  Bundler: Use `bundle info [gemname]` to see where a bundled gem is installed.
New jekyll site installed in D:/wiecejwolnosci/site2.
PS D:\wiecejwolnosci> cd .\site2\
PS D:\wiecejwolnosci\site2> ls


    Directory: D:\wiecejwolnosci\site2


Mode                LastWriteTime         Length Name
----                -------------         ------ ----
d-----       05/03/2021     14:37                _posts
-a----       05/03/2021     14:37             56 .gitignore
-a----       05/03/2021     14:37            419 404.html
-a----       05/03/2021     14:37            539 about.markdown
-a----       05/03/2021     14:37           1155 Gemfile
-a----       05/03/2021     14:38           2038 Gemfile.lock
-a----       05/03/2021     14:37            175 index.markdown
-a----       05/03/2021     14:37           2080 _config.yml


PS D:\wiecejwolnosci\site2> bundler install
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bundler 2.2.12
Using colorator 1.1.0
Using concurrent-ruby 1.1.8
Using eventmachine 1.2.7 (x64-mingw32)
Using http_parser.rb 0.6.0
Using em-websocket 0.5.2
Using ffi 1.14.2 (x64-mingw32)
Using i18n 1.8.9
Using sassc 2.4.0 (x64-mingw32)
Using jekyll-sass-converter 2.1.0
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using listen 3.4.1
Using jekyll-watch 2.2.1
Using rexml 3.2.4
Using kramdown 2.3.0
Using kramdown-parser-gfm 1.1.0
Using liquid 4.0.3
Using mercenary 0.4.0
Using pathutil 0.16.2
Using rouge 3.26.0
Using safe_yaml 1.0.5
Using unicode-display_width 1.7.0
Using terminal-table 2.0.0
Using jekyll 4.2.0
Using jekyll-Feed 0.15.1
Using jekyll-SEO-tag 2.7.1
Using minima 2.5.1
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using tzinfo-data 1.2021.1
Using wdm 0.1.1
Bundle complete! 6 Gemfile dependencies,35 gems Now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.
PS D:\wiecejwolnosci\site2> bundler exec jekyll serve --livereload  
Configuration file: D:/wiecejwolnosci/site2/_config.yml
            Source: D:/wiecejwolnosci/site2
       Destination: D:/wiecejwolnosci/site2/_site
 Incremental build: disabled. Enable with --incremental
      Generating...
       Jekyll Feed: Generating Feed for posts
                    done in 1.494 seconds.
 Auto-regeneration: enabled for 'D:/wiecejwolnosci/site2'
Unable to load the EventMachine C extension; To use the pure-ruby reactor,require 'em/pure_ruby'
                    ------------------------------------------------
      Jekyll 4.2.0   Please append `--trace` to the `serve` command 
                     for any additional information or backtrace. 
                    ------------------------------------------------
Traceback (most recent call last):
        22: from C:/Ruby27-x64/bin/jekyll:23:in `<main>'
        21: from C:/Ruby27-x64/bin/jekyll:23:in `load'
        20: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/exe/jekyll:15:in `<top (required)>'
        19: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary.rb:21:in `program'
        18: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/program.rb:44:in `go'
        17: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `execute'
        16: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `each'
        15: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/mercenary-0.4.0/lib/mercenary/command.rb:221:in `block in execute'
        14: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:86:in `block (2 levels) in init_with_program'
        13: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `process_with_graceful_fail'
        12: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `each'
        11: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/command.rb:91:in `block in process_with_graceful_fail'
        10: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:98:in `process'
         9: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:143:in `register_reload_hooks'
         8: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve.rb:143:in `require_relative'
         7: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:3:in `<top (required)>'
         6: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/jekyll-4.2.0/lib/jekyll/commands/serve/live_reload_reactor.rb:3:in `require'
         5: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/em-websocket-0.5.2/lib/em-websocket.rb:3:in `<top (required)>'
         4: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/em-websocket-0.5.2/lib/em-websocket.rb:3:in `require'
         3: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/eventmachine.rb:8:in `<top (required)>'
         2: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/eventmachine.rb:8:in `require'
         1: from C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/rubyeventmachine.rb:2:in `<top (required)>'
C:/Ruby27-x64/lib/ruby/gems/2.7.0/gems/eventmachine-1.2.7-x64-mingw32/lib/rubyeventmachine.rb:2:in `require': cannot load such file -- 2.7/rubyeventmachine (LoadError)

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)