Jekyll Crashing on M1 Mac

I’ve tried to do some work on one of my Jekyll sites this morning, but when I run jekyll s from the Git repository, Jekyll just crashes with a note saying:

[NOTE]
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details: https://www.ruby-lang.org/bugreport.html

[IMPORTANT]
Don't forget to include the Crash Report log file under
DiagnosticReports directory in bug reports.

If I run ruby -v it gives me the latest version, and this was all working a couple days ago.

ruby 3.0.2p107 (2021-07-07 revision 0db68f0233) [arm64-darwin20]

I’ve uploaded the full crash report to pastebin. See here.

The only change I’ve made is that I’ve upgraded the OS to the latest version yesterday (Big Sur 11.5.2).

I’ve also done all the usual stuff, like bundle update to make sure everything is up to date.

Any assistance would be greatly appreciate here.

Thanks,

Kev

I’m getting a Forbidden error.

What do other people say on StackOverflow if you Google your error?

Can you get anything in Ruby to run?
Even the Ruby console?

Ruby
# or
irb

Might be a Ruby thing not Jekyll.

Either way a reinstall of Ruby and Jekyll and checking your PATH setup could help

Ah crap, I made the paste private instead of unlisted. Fixed now so you should be able to access it.

I’ve tried reinstalling both Ruby and Jekyll, but it didn’t work. The Mac comes with Ruby 2.6 bundled, and paths are correct, that doesn’t even work, never mind upgrading to v3 using home brew.

I’ll try and run Ruby when I’m at my machine shortly and will update.

1 Like

Both Ruby and irb commands work.

1 Like

I was afraid I’d run into same problem. When I ran jekyll serve I got:
Could not find listen-3.6.0 in any of the sources
so I dared run my full update chain:

brew update
brew upgrade
brew cleanup -s
gem update

and now things are all fine and dandy on an M1.

1 Like

Ruby 2.6 will work.

You can use bundler to install Jekyll in vendor in project gems. i.e. not a global Jekyll gem.

Then later you can use custom Ruby (I recommend 3) and add it to your PATH (it looks like that’s already set up). The system Ruby and the system gems are frozen since Catalina, so it is more flexible to have a custom Ruby that you upgrade whenever you need

Sorry no new commands to recommend but Michael’s comments above could help.

Your pastebin is public but really vague. Nothing about what failed in Ruby or Jekyll other than maybe ffi_c ?

Another M1 topic including ffi_c Jekyll Installation on Macs w/ARM64 w/o Package Manager

So I managed to get this working by basically removing all of the non Mac bundled version of Ruby and Jekyll. So:

brew uninstall ruby

Then I followed @michaelbach solution above to update everything and cleanup brew. I then re-installed using the Mac bundled 2.6 instead of the latest 3.0.

I then followed the Mac Jekyll install process with the following:

gem install --user-install bundler jekyll
echo 'export PATH="$HOME/.gem/ruby/2.6.0/bin:$PATH"' >> ~/.zshrc

When I then ran jekyll s from my Jekyll repository, I got zsh: command not found: jekyll. So I had to change the install command to the following:

sudo gem install bundler jekyll

That seemed to have worked and I can sun the local server now. HOWEVER Jekyll recommends that global gem installs shouldn’t happen, so I’m not really happy with this solution, but it’s working.

If anyone has a solution for the command not found issue, I’m all ears. :slight_smile:

Have look at where Jekyll exists

ls ~/.gem/ruby/2.6.0/bin

Is it there?

What about your PATH?

echo $PATH

also make sure the bin is near the start of the PATH as it is evaluated left to right.

Did you reload you shell to get the path update? Are you definitely using ZSH and not Bash?

Note also when you do use Ruby 3, it doesn’t use .gem location anymore.

Yeah using sudo will install to /usr/.../

Also can I suggest not installing Jekyll using gem install ? Just have Bundler at the user level and check is it is in ~/.gem etc. And then use Gemfile and Bundler to install Jekyll per project for more robustness across projects and machines, with appropriate Jekyll 3.9, Jekyll 4.1, 4.2 etc. as needed

Another approach is change permissions of this directory owned by root, so that all users can edit it

sudo chmod 755 /usr/local # or /usr/bin  - I don't know anymore

to get to drwxr-xr-x

Then you can install without sudo or --user-install

gem install jekyll bundler
which -a bundler
/usr/local/opt/ruby/bin/bundler # first
/usr/bin/bundler # second, not used

From Ruby 3 on, a custom Ruby comes with its own Bundler too - /usr/local/opt/ruby/bin/bundler

so you could even leave out install Bundler at the user level

Is your path ok? I don’t use zsh yet, in bash_profile it’s like this:

export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH=/Users/bach/.gem/ruby/2.6.0/bin:$PATH
export GEM_HOME=$HOME/gems
export PATH=$HOME/gems/bin:$PATH

Of course the "/Users/bach/ needs to be adapted. Probably could use $Home there too, but I don’t dare to change the winning team :slight_smile: .

Yes, the path is correct.
Yes, I’m using ZSH.

% ls ~/.gem/ruby/2.6.0/bin
bundle		kramdown	rougify
bundler		listen		safe_yaml
% echo $SHELL
/bin/zsh
% echo $PATH
/Users/kev/.gem/ruby/2.6.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin

I guess try this again to add jekyll to that bin.

gem install --user-install jekyll

Then run ls again.

So that worked, but now I’m back to square one with Jekyll crashing when I run jekyll s :rofl:

If I try bundle exec jekyll serve I get:

jekyll 4.2.0 | Error: no implicit conversion of File into String

oh my, I’m sorry and out of ideas too…

No problem, thanks for all the help! I might just learn 11ty at this point and use that instead haha.

This error sounds like it could have to do with the project you are working on and not Jekyll itself. You might want to create a new thread, share your repo if publicly available, and perhaps solve the problem.

Could you try the basic steps to create a new default site using Jekyll just to make sure it’s not coffee related?

Hey Bill,

Thanks for the reply. This isn’t an issue with the project, as it effects more than one and I can use them just fine on my Linux box.

If you want to check though, here’s an example - GitHub - kevquirk/512kb.club: Website for the 512 KB Club

Make it

bundle exec jekyll serve --trace

In general works great for verbose errors.

Also try

--verbose

Not good for general use as it is noisy but can tell you the exact Ruby line that was run before your error.


Similar issue on another project relating to YAML indentation

Topic

Also you might find that your exclude value has overwritten the default but left out the existing values

Try adding

  - vendor