commonmarker: Dependency error on new M1 Mac
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.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Reactions: 2
- Comments: 15 (3 by maintainers)
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:
It looks as if the gems are installed in your home directory’s
.gemdirectory, and notvendornor/Library. If I were in your position right now I’d be trying this in the tutorial project dir:Then, verify that the native extensions are all arm64:
Here’s me doing this now:
Hope this helps.
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.
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
jekyllandffi. The workaround for now is to install jekyll and gems using thex86_64ruby and bundle commands. Prefix any bundle commands withx86_64and everything works fine. Hopefullyarm64support will come soon.@kivikakk Interesting that you get only the
arm64gems installed locally, I have botharm64andx86_64binaries installed. In any case, I tried what you suggested, and I’m still getting errors runningjekylleven 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!