简体   繁体   中英

Ruby (or FFI?) error when executing Jekyll commands

I want to create a new Webpage using Jekyll, but when I execute jekyll new <page> , Ruby crashes with a really long Crash Report that starts like this:

/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275: [BUG] Bus Error at 0x0000000100e08000
ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:                    
     * ~/Library/Logs/DiagnosticReports                                     
     * /Library/Logs/DiagnosticReports                                      
   for more details.                                                        
Don't forget to include the above Crash Report log file in bug reports.     

-- Control frame information -----------------------------------------------
c:0027 p:---- s:0156 e:000155 CFUNC  :attach
c:0026 p:0258 s:0150 e:000149 METHOD /Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275
c:0025 p:0023 s:0130 e:000129 METHOD /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:40
c:0024 p:0012 s:0125 e:000124 CLASS  /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:5
c:0023 p:0007 s:0122 e:000121 CLASS  /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:4
c:0022 p:0007 s:0119 e:000118 TOP    /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:3 [FINISH]
c:0021 p:---- s:0116 e:000115 CFUNC  :require_relative
c:0020 p:0247 s:0111 e:000110 CLASS  /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:60
c:0019 p:0007 s:0107 e:000106 CLASS  /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:6
c:0018 p:0014 s:0104 e:000103 TOP    /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:5 [FINISH]
c:0017 p:---- s:0101 e:000100 CFUNC  :require_relative
c:0016 p:0021 s:0096 e:000095 TOP    /Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31 [FINISH]
c:0015 p:---- s:0093 e:000092 CFUNC  :require
c:0014 p:0110 s:0088 e:000087 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0013 p:0006 s:0076 e:000075 TOP    /Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll/converters/scss.rb:3 [FINISH]
c:0012 p:---- s:0073 e:000072 CFUNC  :require
c:0011 p:0110 s:0068 e:000067 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0010 p:0013 s:0056 e:000055 TOP    /Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll-sass-converter.rb:4 [FINISH]
c:0009 p:---- s:0053 e:000052 CFUNC  :require
c:0008 p:0110 s:0048 e:000047 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0007 p:0226 s:0036 e:000035 TOP    /Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/lib/jekyll.rb:195 [FINISH]
c:0006 p:---- s:0033 e:000032 CFUNC  :require
c:0005 p:0110 s:0028 e:000027 METHOD /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54
c:0004 p:0041 s:0016 e:000015 TOP    /Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/exe/jekyll:8 [FINISH]
c:0003 p:---- s:0013 e:000012 CFUNC  :load
c:0002 p:0109 s:0008 E:001cc0 EVAL   /usr/local/bin/jekyll:23 [FINISH]
c:0001 p:0000 s:0003 E:000cc0 (none) [FINISH]


-- Ruby level backtrace information ----------------------------------------
/usr/local/bin/jekyll:23:in `<main>'
/usr/local/bin/jekyll:23:in `load'
/Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/exe/jekyll:8:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/jekyll-4.2.2/lib/jekyll.rb:195:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/jekyll-sass-converter-2.2.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:5:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:6:in `<module:SassC>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:60:in `<module:Native>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:60:in `require_relative'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:3:in `<top (required)>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:4:in `<module:SassC>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native/native_context_api.rb:5:in `<module:Native>'
/Library/Ruby/Gems/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:40:in `attach_function'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275:in `attach_function'
/Library/Ruby/Gems/2.6.0/gems/ffi-1.15.5/lib/ffi/library.rb:275:in `attach'

I am using a MacBook Pro with M1 Pro. Ruby has been installed via Homebrew and always worked fine on my Intel-MacBook. Does somebody know this error?

Regards,

Yannick

The issue was the following: I installed Ruby with Homebrew, but macOS ships its own Ruby, but in the wring version. I followed this tutorial and that solved my problem.

I think it's an issue specific to M1 MacBooks, You can try

arch -arch x86_64 bundle install
arch -arch x86_64 bundle exec jekyll serve

Although I believe it's not an "ideal fix". Solution suggested by @Yannick seems promising, but I haven't tried it.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM