Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dependency error on new M1 Mac #128

Closed
venkatasg opened this issue Dec 28, 2020 · 15 comments
Closed

Dependency error on new M1 Mac #128

venkatasg opened this issue Dec 28, 2020 · 15 comments

Comments

@venkatasg
Copy link

venkatasg commented Dec 28, 2020

I'm trying to build my Github Pages website locally on my M1 mac Mini using this guide. However, whenever I execute bundle exec jekyll serve, I get the following error:

  Dependency Error: Yikes! It looks like you don't have jekyll-commonmark-ghpages or one of its dependencies installed. In 
order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 
'dlopen(/Users/venkat/Sites/venkatasg.github.io/vendor/bundle/ruby/2.6.0/gems/commonmarker-
0.17.13/lib/commonmarker/commonmarker.bundle, 0x0009): missing compatible arch in 
/Users/venkat/Sites/venkatasg.github.io/vendor/bundle/ruby/2.6.0/gems/commonmarker-
0.17.13/lib/commonmarker/commonmarker.bundle - 
/Users/venkat/Sites/venkatasg.github.io/vendor/bundle/ruby/2.6.0/gems/commonmarker-
0.17.13/lib/commonmarker/commonmarker.bundle' If you run into trouble, you can find helpful resources at 
https://jekyllrb.com/help/!
jekyll 3.8.7 | Error:  jekyll-commonmark-ghpages

I can't seem to find any help regarding this dependency error - I suspect this has something to do with the new arm64 architecture of the M1 Macs, since the error says missing compatible arch. Any help would be appreciated.

@kivikakk
Copy link
Collaborator

I'm curious, did you copy your vendor directory from a previous non-M1 Mac? The commonmarker.bundle should probably fail to build at all, rather than build with incorrect arch. I'm looking into it but it might be a little bit.

@kivikakk
Copy link
Collaborator

Hm, okay, I just tried the tutorial myself, and it worked okay (log for your interest). Could you try deleting your vendor directory then run bundle install again? This should redownload and recompile gems, so hopefully you'll get a commonmarker.bundle with the right arch.

@venkatasg
Copy link
Author

venkatasg commented Dec 29, 2020

I have cloned my jekyll repo as a clean directory (without any vendor directory - it wasn't in source control), and did the bundle install step only (since there's already a Gemfile) - I still get the same error.

I just tried the tutorial I linked completely (as in setting up a sample/new jekyll website rather than trying to clone my own) and got this error when running the bundle exec jekyll new --force --skip-bundle . step:

bundler: failed to load command: jekyll (/Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/bin/jekyll)
Traceback (most recent call last):
	30: from /Users/venkat/.gem/ruby/2.6.0/bin/bundle:23:in `<main>'
	29: from /Users/venkat/.gem/ruby/2.6.0/bin/bundle:23:in `load'
	28: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'
	27: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	26: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'
	25: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'
	24: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	23: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'
	22: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	21: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	20: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	19: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli.rb:497:in `exec'
	18: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:28:in `run'
	17: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `kernel_load'
	16: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `load'
	15: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in `<top (required)>'
	14: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in `load'
	13: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
	12: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `require'
	11: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
	10: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `require'
	 9: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
	 8: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `require'
	 7: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
	 6: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `require'
	 5: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
	 4: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
	 3: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
	 2: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `require'
	 1: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:4:in `<top (required)>'
/Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:4:in `require': cannot load such file -- 2.6/ffi_c (LoadError)
	31: from /Users/venkat/.gem/ruby/2.6.0/bin/bundle:23:in `<main>'
	30: from /Users/venkat/.gem/ruby/2.6.0/bin/bundle:23:in `load'
	29: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/exe/bundle:37:in `<top (required)>'
	28: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/friendly_errors.rb:130:in `with_friendly_errors'
	27: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/exe/bundle:49:in `block in <top (required)>'
	26: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli.rb:24:in `start'
	25: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/base.rb:485:in `start'
	24: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli.rb:30:in `dispatch'
	23: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor.rb:392:in `dispatch'
	22: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/invocation.rb:127:in `invoke_command'
	21: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/vendor/thor/lib/thor/command.rb:27:in `run'
	20: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli.rb:497:in `exec'
	19: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:28:in `run'
	18: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `kernel_load'
	17: from /Users/venkat/.gem/ruby/2.6.0/gems/bundler-2.2.3/lib/bundler/cli/exec.rb:63:in `load'
	16: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in `<top (required)>'
	15: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in `load'
	14: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
	13: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `require'
	12: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
	11: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `require'
	10: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
	 9: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `require'
	 8: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
	 7: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `require'
	 6: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
	 5: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
	 4: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
	 3: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `require'
	 2: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
	 1: from /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
/Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `require': dlopen(/Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Users/venkat/Sites/my-jekyll-website/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle (LoadError)

I'm not sure what this new error means. Looks like it might be a Jekyll issue.

@gjtorikian
Copy link
Owner

What does gem pristine commonmarker (and for that matter, gem pristine ffi) do for you?

@venkatasg
Copy link
Author

venkatasg commented Dec 31, 2020

Currently gem pristine install doesn't do anything since it needs permission to write to Library folder. I would prefer to install all gems locally in the vendor/bundle folder than in system folders.

I'm considering closing this issue, since on closer inspection, it seems like this may be an issue with jekyll, or the way I've set up my gem and bundle environments. @kivikakk On your M1 Mac, can you confirm that running the tutorial I linked command-by-command to create a new template repository works without a hitch? I still keep getting this error after a lot of messing around, which seems to point towards an issue with jekyll.

bundler: failed to load command: jekyll (/Users/venkat/.gem/ruby/2.6.0/bin/jekyll)
LoadError: dlopen(/Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle
  /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `require'
  /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `require'
  /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
  /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `require'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `require'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `require'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `require'
  /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
  /Users/venkat/.gem/ruby/2.6.0/bin/jekyll:23:in `load'
  /Users/venkat/.gem/ruby/2.6.0/bin/jekyll:23:in `<top (required)>'

When I run ~/.gem/ruby/2.6.0/bin/jekyll serve (just to see if it even works), I get this:

Traceback (most recent call last):
	21: from /Users/venkat/.gem/ruby/2.6.0/bin/jekyll:23:in `<main>'
	20: from /Users/venkat/.gem/ruby/2.6.0/bin/jekyll:23:in `load'
	19: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
	18: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	17: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	16: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
	15: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	14: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	13: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
	12: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	11: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	10: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
	 9: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 8: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 7: from /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
	 6: from /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
	 5: from /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
	 4: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 3: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 2: from /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:4:in `<top (required)>'
	 1: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': cannot load such file -- 2.6/ffi_c (LoadError)
	22: from /Users/venkat/.gem/ruby/2.6.0/bin/jekyll:23:in `<main>'
	21: from /Users/venkat/.gem/ruby/2.6.0/bin/jekyll:23:in `load'
	20: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
	19: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	18: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	17: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
	16: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	15: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	14: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
	13: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	12: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	11: from /Users/venkat/.gem/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
	10: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 9: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 8: from /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
	 7: from /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
	 6: from /Users/venkat/.gem/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
	 5: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 4: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
	 3: from /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
	 2: from /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
	 1: from /Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require'
/Library/Ruby/Site/2.6.0/rubygems/core_ext/kernel_require.rb:92:in `require': dlopen(/Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle (LoadError)

Let me know if this is unrelated to the common marker package so I can close this issue. In any case, I'd appreciate any help figuring out why I can't seem to get jekyll to run on my machine. Thank you!

@kivikakk
Copy link
Collaborator

@kivikakk On your M1 Mac, can you confirm that running the tutorial I linked command-by-command to create a new template repository works without a hitch? I still keep getting this error after a lot of messing around, which seems to point towards an issue with jekyll.

Yes, the log attached to my last comment was the end of running through the tutorial commands exactly, and culminated in jekyll successfully serving requests.

From your logs:

bundler: failed to load command: jekyll (/Users/venkat/.gem/ruby/2.6.0/bin/jekyll)
LoadError: dlopen(/Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Users/venkat/.gem/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle

It looks as if the gems are installed in your home directory's .gem directory, and not vendor nor /Library. If I were in your position right now I'd be trying this in the tutorial project dir:

rm -rf vendor .bundle
bundle config set --local path 'vendor/bundle'
bundle install

Then, verify that the native extensions are all arm64:

find vendor -name \*.bundle -exec file '{}' \;

Here's me doing this now:

$ pwd
/Users/kameliya/Code/scratch/jekyll
$ ls
404.html        Gemfile         Gemfile.lock    _config.yml     _posts/         _site/          about.markdown  index.markdown  vendor/
$ rm -rf vendor .bundle
$ bundle config set --local path 'vendor/bundle'
$ bundle install
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 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 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`.
Fetching gem metadata from https://rubygems.org/.........
Fetching public_suffix 4.0.6
Installing public_suffix 4.0.6
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using bundler 2.1.4
Fetching colorator 1.1.0
Installing colorator 1.1.0
Fetching concurrent-ruby 1.1.7
Installing concurrent-ruby 1.1.7
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching em-websocket 0.5.2
Installing em-websocket 0.5.2
Fetching ffi 1.14.2
Installing ffi 1.14.2 with native extensions
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Fetching i18n 1.8.5
Installing i18n 1.8.5
Fetching sassc 2.4.0
Installing sassc 2.4.0 with native extensions
Fetching jekyll-sass-converter 2.1.0
Installing jekyll-sass-converter 2.1.0
Fetching rb-fsevent 0.10.4
Installing rb-fsevent 0.10.4
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching listen 3.3.3
Installing listen 3.3.3
Fetching jekyll-watch 2.2.1
Installing jekyll-watch 2.2.1
Fetching rexml 3.2.4
Installing rexml 3.2.4
Fetching kramdown 2.3.0
Installing kramdown 2.3.0
Fetching kramdown-parser-gfm 1.1.0
Installing kramdown-parser-gfm 1.1.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching mercenary 0.4.0
Installing mercenary 0.4.0
Fetching pathutil 0.16.2
Installing pathutil 0.16.2
Fetching rouge 3.26.0
Installing rouge 3.26.0
Fetching safe_yaml 1.0.5
Installing safe_yaml 1.0.5
Fetching unicode-display_width 1.7.0
Installing unicode-display_width 1.7.0
Fetching terminal-table 2.0.0
Installing terminal-table 2.0.0
Fetching jekyll 4.2.0
Installing jekyll 4.2.0
Fetching jekyll-feed 0.15.1
Installing jekyll-feed 0.15.1
Fetching jekyll-seo-tag 2.7.1
Installing jekyll-seo-tag 2.7.1
Fetching minima 2.5.1
Installing minima 2.5.1
Bundle complete! 6 Gemfile dependencies, 31 gems now installed.
Gems in the group benchmark were not installed.
Bundled gems are installed into `./vendor/bundle`
Post-install message from i18n:

HEADS UP! i18n 1.1 changed fallbacks to exclude default locale.
But that may break your application.

If you are upgrading your Rails application from an older version of Rails:

Please check your Rails app for 'config.i18n.fallbacks = true'.
If you're using I18n (>= 1.1.0) and Rails (< 5.2.2), this should be
'config.i18n.fallbacks = [I18n.default_locale]'.
If not, fallbacks will be broken in your app by I18n 1.1.x.

If you are starting a NEW Rails application, you can ignore this notice.

For more info see:
https://github.com/svenfuchs/i18n/releases/tag/v1.1.0

$ find vendor -name \*.bundle -exec file '{}' \; | sed 's_vendor/bundle/ruby/2..../__'
extensions/arm64-darwin-20/2.7.0/sassc-2.4.0/sassc/libsass.bundle: Mach-O 64-bit bundle arm64
extensions/arm64-darwin-20/2.7.0/ffi-1.14.2/ffi_c.bundle: Mach-O 64-bit bundle arm64
extensions/arm64-darwin-20/2.7.0/http_parser.rb-0.6.0/ruby_http_parser.bundle: Mach-O 64-bit bundle arm64
extensions/arm64-darwin-20/2.7.0/eventmachine-1.2.7/fastfilereaderext.bundle: Mach-O 64-bit bundle arm64
extensions/arm64-darwin-20/2.7.0/eventmachine-1.2.7/rubyeventmachine.bundle: Mach-O 64-bit bundle arm64
gems/sassc-2.4.0/ext/libsass.bundle: Mach-O 64-bit bundle arm64
gems/sassc-2.4.0/lib/sassc/libsass.bundle: Mach-O 64-bit bundle arm64
gems/ffi-1.14.2/ext/ffi_c/ffi_c.bundle: Mach-O 64-bit bundle arm64
gems/ffi-1.14.2/lib/ffi_c.bundle: Mach-O 64-bit bundle arm64
gems/http_parser.rb-0.6.0/ext/ruby_http_parser/ruby_http_parser.bundle: Mach-O 64-bit bundle arm64
gems/http_parser.rb-0.6.0/lib/ruby_http_parser.bundle: Mach-O 64-bit bundle arm64
gems/eventmachine-1.2.7/ext/fastfilereader/fastfilereaderext.bundle: Mach-O 64-bit bundle arm64
gems/eventmachine-1.2.7/ext/rubyeventmachine.bundle: Mach-O 64-bit bundle arm64
gems/eventmachine-1.2.7/lib/fastfilereaderext.bundle: Mach-O 64-bit bundle arm64
gems/eventmachine-1.2.7/lib/rubyeventmachine.bundle: Mach-O 64-bit bundle arm64
$ bundle exec jekyll serve
Configuration file: /Users/kameliya/Code/scratch/jekyll/_config.yml
            Source: /Users/kameliya/Code/scratch/jekyll
       Destination: /Users/kameliya/Code/scratch/jekyll/_site
 Incremental build: disabled. Enable with --incremental
      Generating... 
       Jekyll Feed: Generating feed for posts
                    done in 0.152 seconds.
 Auto-regeneration: enabled for '/Users/kameliya/Code/scratch/jekyll'
    Server address: http://127.0.0.1:4000/
  Server running... press ctrl-c to stop.

Hope this helps.

@gjtorikian
Copy link
Owner

Thanks for the help @kivikakk <3 Happy new year!

@venkatasg
Copy link
Author

venkatasg commented Dec 31, 2020

@kivikakk Interesting that you get only the arm64 gems installed locally, I have both arm64 and x86_64 binaries installed. In any case, I tried what you suggested, and I'm still getting errors running jekyll even when it is installed locally. Log is attached below. although I suspect I could find the answer in one of the ffi issues opened in the last two weeks related to M1 Macs.

Happy New Year!

~/Sites  $ mkdir jek
~/Sites  $ cd jek
~/S/jek  $ bundle init
Writing new Gemfile to /Users/venkat/Sites/jek/Gemfile
~/S/jek  $ bundle config set --local path 'vendor/bundle'
~/S/jek  $ bundle install
The Gemfile specifies no dependencies
Resolving dependencies...
Bundle complete! 0 Gemfile dependencies, 1 gem now installed.
Bundled gems are installed into `./vendor/bundle`
~/S/jek  $ bundle add jekyll
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching gem metadata from https://rubygems.org/..........
Fetching gem metadata from https://rubygems.org/.
Resolving dependencies...
Fetching public_suffix 4.0.6
Installing public_suffix 4.0.6
Fetching addressable 2.7.0
Installing addressable 2.7.0
Using bundler 2.1.4
Fetching colorator 1.1.0
Installing colorator 1.1.0
Fetching concurrent-ruby 1.1.7
Installing concurrent-ruby 1.1.7
Fetching eventmachine 1.2.7
Installing eventmachine 1.2.7 with native extensions
Fetching http_parser.rb 0.6.0
Installing http_parser.rb 0.6.0 with native extensions
Fetching em-websocket 0.5.2
Installing em-websocket 0.5.2
Fetching ffi 1.14.2
Installing ffi 1.14.2 with native extensions
Fetching forwardable-extended 2.6.0
Installing forwardable-extended 2.6.0
Fetching i18n 1.8.5
Installing i18n 1.8.5
Fetching sassc 2.4.0
Installing sassc 2.4.0 with native extensions
Fetching jekyll-sass-converter 2.1.0
Installing jekyll-sass-converter 2.1.0
Fetching rb-fsevent 0.10.4
Installing rb-fsevent 0.10.4
Fetching rb-inotify 0.10.1
Installing rb-inotify 0.10.1
Fetching listen 3.4.0
Installing listen 3.4.0
Fetching jekyll-watch 2.2.1
Installing jekyll-watch 2.2.1
Fetching rexml 3.2.4
Installing rexml 3.2.4
Fetching kramdown 2.3.0
Installing kramdown 2.3.0
Fetching kramdown-parser-gfm 1.1.0
Installing kramdown-parser-gfm 1.1.0
Fetching liquid 4.0.3
Installing liquid 4.0.3
Fetching mercenary 0.4.0
Installing mercenary 0.4.0
Fetching pathutil 0.16.2
Installing pathutil 0.16.2
Fetching rouge 3.26.0
Installing rouge 3.26.0
Fetching safe_yaml 1.0.5
Installing safe_yaml 1.0.5
Fetching unicode-display_width 1.7.0
Installing unicode-display_width 1.7.0
Fetching terminal-table 2.0.0
Installing terminal-table 2.0.0
Fetching jekyll 4.2.0
Installing jekyll 4.2.0
~/S/jek  $ bundle install
Using public_suffix 4.0.6
Using addressable 2.7.0
Using bundler 2.1.4
Using colorator 1.1.0
Using concurrent-ruby 1.1.7
Using eventmachine 1.2.7
Using http_parser.rb 0.6.0
Using em-websocket 0.5.2
Using ffi 1.14.2
Using forwardable-extended 2.6.0
Using i18n 1.8.5
Using sassc 2.4.0
Using jekyll-sass-converter 2.1.0
Using rb-fsevent 0.10.4
Using rb-inotify 0.10.1
Using listen 3.4.0
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
Bundle complete! 1 Gemfile dependency, 28 gems now installed.
Bundled gems are installed into `./vendor/bundle`
~/S/jek  $ bundle exec jekyll serve
bundler: failed to load command: jekyll (/Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/bin/jekyll)
LoadError: dlopen(/Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle, 0x0009): missing compatible arch in /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle - /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi_c.bundle
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `require'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:6:in `rescue in <top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/ffi-1.14.2/lib/ffi.rb:3:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `require'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc/native.rb:3:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `require_relative'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/sassc-2.4.0/lib/sassc.rb:31:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `require'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll/converters/scss.rb:3:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `require'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-sass-converter-2.1.0/lib/jekyll-sass-converter.rb:4:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `require'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/lib/jekyll.rb:195:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `require'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/gems/jekyll-4.2.0/exe/jekyll:8:in `<top (required)>'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in `load'
  /Users/venkat/Sites/jek/vendor/bundle/ruby/2.6.0/bin/jekyll:23:in `<top (required)>'

@kivikakk
Copy link
Collaborator

kivikakk commented Jan 1, 2021

Which Ruby are you using? The system Ruby is a universal binary, so the weirdness might be related to that if you're using it. I'm using an rbenv-installed Ruby which is arm64-only.

@venkatasg
Copy link
Author

Yes I'm using system ruby. I'll see if perhaps rbenv installed ruby works better.

@venkatasg
Copy link
Author

I'm posting this for anyone else who may come across this issue. As @sanzaru pointed out in this issue thread the problem is in jekyll and ffi. The workaround for now is to install jekyll and gems using the x86_64 ruby and bundle commands. Prefix any bundle commands with x86_64 and everything works fine. Hopefully arm64 support will come soon.

@kivikakk
Copy link
Collaborator

kivikakk commented Jan 4, 2021

Something doesn't really add up here -- your logs show you're using ffi 1.14.2, which is the same as mine. I suspect a native-only Ruby build would work fine, like I've done. The system-installed universal binary probably gets confused when building extensions and doesn't know how to build universal extensions. As shown above, jekyll and ffi work well on arm64 today.

@sanzaru
Copy link

sanzaru commented Jan 4, 2021

Something doesn't really add up here -- your logs show you're using ffi 1.14.2, which is the same as mine. I suspect a native-only Ruby build would work fine, like I've done. The system-installed universal binary probably gets confused when building extensions and doesn't know how to build universal extensions. As shown above, jekyll and ffi work well on arm64 today.

Installing a completely new ruby environment sounds not like a solution to me and some people don't have the permissions or simply don't want to compromise the system. The universal binary consists of arm and x86 code and should automatically choose the correct one. If you try to run it with the arm64 part of the universal binary you still get the error while the x86 one works fine, so for me this does not look like a confusion, but more like missing support for the architecture.

@kivikakk
Copy link
Collaborator

kivikakk commented Jan 4, 2021

Sure, just trying to point to a solution that works now. If you want it all native, it can be done, but as with most things on M1, it won’t necessarily be pretty yet. Rosetta on the other hand usually Just Works™️.

My hunch is that the system/universal Ruby doesn’t know how to build a universal bundle and instead defaults to building extensions as x86-64 for whatever reason; it might be something in Ruby itself as installed by Apple, mkmf, something specific to the ffi gem—I’m not sure. Something somewhere along the way needs to be taught how to build universal binaries itself.

@gjtorikian
Copy link
Owner

I'd also like to just quickly point out that this project is run entirely by volunteers, and the ask of getting it working "as it always has" on brand new architecture should be taken with the added context that we're just now beginning to come out of a very difficult year for many people. Getting Commonmark to turn into HTML is, for me personally, not the highest on my list of priorities at this moment.

It sounds like @kivikakk provided a solution, and if or when CI supports the new architecture I'm sure this project and others will be able to test for it.

Until then let's provide any suggestions and insights we all can.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants