Under macOS Mojave 10.14.6, When I tried to do gem install jekyll locally, I met the following error:
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h
it is due to xcode has been upgraded, but the command line tool is not setting up correctly.
the solution is as following:
sudo rm -rf /Library/Developer/CommandLineTools
sudo xcodebuild -license accept
after fixed that error, continune to build jekyll, it complains ruby version is too low.
ERROR: Error installing jekyll:
jekyll-sass-converter requires Ruby version >= 2.4.0.
~ moreless$ which ruby
~ moreless$ brew upgrade ruby
Warning: ruby 2.6.5 already installed
therefore, reinstall ruby, and got following message:
$ brew reinstall ruby
==> Reinstalling ruby
==> Downloading https://homebrew.bintray.com/bottles/ruby-2.6.5.mojave.bottle.1.tar.gz
Already downloaded: /Users/yonwang/Library/Caches/Homebrew/downloads/182d59bf6e0c972f8d9271f628e7b87879c16b1954b0c886d286f83519c7e7b1 — ruby-2.6.5.mojave.bottle.1.tar.gz
==> Pouring ruby-2.6.5.mojave.bottle.1.tar.gz
By default, binaries installed by gem will be placed into:
/usr/local/lib/ruby/gems/2.6.0/binYou may want to add this to your PATH.ruby is keg-only, which means it was not symlinked into /usr/local,
because macOS already provides this software and installing another version in
parallel can cause all kinds of trouble.If you need to have ruby first in your PATH run:
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> ~/.bash_profileFor compilers to find ruby you may need to set:
After modifying .bash_profile as suggested, path to ruby will be updated to the new path.