4

When I run $ jekyllor $ jekyll serve it raises the following error:

-bash: /usr/local/bin/jekyll: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

I checked /System/Library/Frameworks/Ruby.framework/Versions/ and Version 2.0 does not exist. It turns out that on the same day I updated on HighSierra, Version 2.3 was installed.

I think Jekyll still looks for Version 2.0. So how can I tell Jekyll to use Ruby 2.3?

Edit:

When I uninstall and then install jekyll, it fails:

$ gem install jekyll
Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
    ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20171111-1004-fgop80.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/ffi-1.9.18 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/ffi-1.9.18/gem_make.out

Solution:

I googled can't find header files for ruby and it turned out that "Command Line Tools for Xcode" must be installed which you can download here: https://developer.apple.com/download/more/

However, I have macOS 10.13 and there is no command line tools for Xcode 8.x (which was the latest version I could install). That's why I searched for Xcode in the Mac App Store and installed Xcode 9. Once, it was installed, a window popped up that said "git requires command line tools. Do you want to install it?". I clicked install and still failed to run $gem install jekyll.

Then I tried $ brew doctor. There were some warnings which I fixed one by one and finally I'm able to run $ gem install jekyll.

2
  • can you provide more details..? What's your rvm/rbenv version..? What's your Jekyll - project directory path (relative to your HOME directory)? How old is your Jekyll project (i.e. what version of Jekyll was your jekyll project directory created with?)
    – ashmaroli
    Oct 3, 2017 at 9:50
  • How about using Cloud9? See: stackoverflow.com/a/45811995/2397550
    – Mr. Hugo
    Oct 4, 2017 at 8:29

1 Answer 1

6

I had the same issue. I just uninstalled jekyll

gem uninstall jekyll

and then installed it again.

gem install jekyll

Then it worked again.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.