How to solve server execution problem with jekyll in macOS M1?

Hallo, Thank you for reading !

using the following code I am unable to execute the server locally

bundle exec jekyll serve

error

Traceback (most recent call last):
9: from /Users/tao/.gem/ruby/2.6.0/bin/bundle:23:in <main>' 8: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:302:in activate_bin_path’
7: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems.rb:272:in find_spec_for_exe' 6: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/dependency.rb:284:in matching_specs’
5: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:45:in filter!' 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:7:in bundler_version’
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:22:in bundler_version_with_reason' 2: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:68:in lockfile_version’
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in lockfile_contents' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/bundler_version_finder.rb:80:in pwd’: Operation not permitted - getcwd (Errno::EPERM)

I’m not a Ruby expert, but it looks like you are using the version of Ruby that comes pre-installed by Apple. You might want to install Ruby 3.x and make sure your environment is set up per the Jekyll Docs:

1 Like

Indeed. Install a custom Ruby. And make sure your PATH is updated to it can be found.

I think newer Ruby comes with Bundler so you can use the one that comes with the custom Ruby

You can also install a user level Bundler

gem install bundler --user-install