jekyll
jekyll copied to clipboard
Apple M1 Pro + Building a static website with Jekyll and GitHub Pages
One of our readers has written to report a problem they've experienced with Building a static website with Jekyll and GitHub Pages. They are working on an Apple M1 Pro, running macOS Monterey version 12.6.2
/en/lessons/building-static-sites-with-jekyll-github-pages /es/lecciones/sitios-estaticos-con-jekyll-y-github-pages
They explain that they are able to walk through the initial steps of the lesson, although they note that:
- homebrew seems to have moved since this lesson was last updated. This reader found that they needed to edit the path for homebrew and ruby before they could move on to the command
jekyll new [SiteName]
(In the lesson, we provide: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
At https://brew.sh/, they provide: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
)
- At this point, they encountered the following two error messages:
cannot load such file -- google/protobuf_c (LoadError)
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': dlopen(/Library/Ruby/Gems/2.6.0/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/2.6/protobuf_c.bundle, 0x0009): tried: '/Library/Ruby/Gems/2.6.0/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/2.6/protobuf_c.bundle' (mach-o file, but is an incompatible architecture (have (x86_64), need (arm64e))) - /Library/Ruby/Gems/2.6.0/gems/google-protobuf-3.21.12-x86_64-darwin/lib/google/2.6/protobuf_c.bundle (LoadError)
- They were unable to find a way to force install the
protobuf
gem. This seems to be an Issue related to the gem not having been updated for M1 architecture.
Hello @yann-ryan. As we have recently been discussing another Apple M-series compatibility issue within #479, I know that you have this set up too (although I'm not sure which OS you're running?).
Might you have time to help me work through these steps to see if we reproduce the same errors?
Hi @anisa-hawes, sure, I can do that. I think I have the same processor and OS version.
@yann-ryan we're you able to test this?
It sounds like some issues are separate from the M1 issue @anisa-hawes. I'd recommend fixing the other issues (like the location for homebrew), and tabling the M1 issue for now if there isn't an easy fix.
This isn't the first M1 bug we've seen, and we may well see it arise for half our lessons. If we give it time, Apple may come up with solutions that resolve this issue for everyone. Maybe that's wishful thinking, but I still don't think we should make it any sort of editorial standard that we run around trying to make our lessons perfectly compatible with the newest and most advanced graphics card major corporations release for large profits
I'm sorry, I've had to give up on this - I can't get past gem install jekyll
. I've tried everything I can think of, reinstalling xcode, editing permissions, running it with sudo, and various stackoverflow and github issue suggestions.
There's alot of guides on M1 chips and Jekyll installation, but they naturally differ in lots of ways.
@anisa-hawes I'm of the mind that we shouldn't spend time trying to debug these cases where an M1 chip is the culprit. I'd be in favor in a case like this of us adding a brief note somewhere in the lesson that says for people with M1 chips, they may need to follow additional directions for installing packages, and we can suggest they look at the software documentation for more information
Thank you, @hawc2.
Our reader made the following slight adjustments to their .zshrc
file, to ensure the correct path for both homebrew and ruby:
export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH
--
I also found this Issue online, which suggests that the protobuf
gem can be installed on an M1 chip if an earlier version of Ruby is used:
# Install ruby 2.6.8
brew install rbenv
rbenv init
rbenv install 2.6.8
rbenv global 2.6.8
ruby --version # ensure the version is 2.6.8
gem install jekyll
jekyll serve