Cannot isntall jekyll: ERROR: Failed to build gem native extension

Here’s the error message

I’m running it on MacOS 15.3.2 (24D81), following the exact steps in Jekyll on macOS | Jekyll • Simple, blog-aware, static sites.

Have searched for all the fixes on this forum/stackoverflow/github/reddit and none of them solve the issue

here’s the environment of my gem. fingers-crossed that someone could help me out

that error I think happens when you don’t have the dev tools needed to build native extensions. I’m not a mac user so not sure how it works there, but on a pc there are 2 ways to install ruby, with and without the dev tools. If you install it without the devtools you get that error.

Lots of people have issues on macs as they have a built in ruby and then they install ruby again and it gets hard to tell which is which?

Your second screen shot sort of looks like you have 2 versions installed - 3.4.0 and 3.4.1 but I am not positive about that.

see if you can find anything about ruby dev tools on a mac. I’m sure there are other threads in here with a solution, seems to come up fairly often.

this thread has a note about needing xcode command tools which I think is your issue.

thanks for the reply! the xcode command line doesn’t seem to be the key cause of the issue

I do have them readily available

if i do xcode-select --install as suggested by other threads, i’m told that it’s already installed

then i would look into whether you have more than one ruby installed - it sort of looked like you did but I’m not positive. more than one ruby installation can cause issues if they are not managed by a ruby version manager. Maybe one has access to the tools and the other doesn’t?

Try the solutions discussed in this GitHub issue ticket:

Thanks both. I tried to reinstall everything related to ruby and reinstalled xcode as per the discussion, and the error went away. Not sure which trick makes the material help.