# MacOS Catalina, ruby bad interpreter error

DevFeed: [MacOS Catalina, ruby bad interpreter error](<https://devfeed.tech/articles/macos-catalina-ruby-bad-interpreter-error-37308.md>)

Original publisher: [Read original article](<https://muffinman.io/blog/macos-catalina-ruby-bad-interpreter-error/>)

Author: Stanko

Published: 2019-12-11T00:00:00Z

Content type: tutorial

Language: en

Sources: [Stanko Tadić](<https://devfeed.tech/sources/stanko-tadic.md>)

Topics: [macOS](<https://devfeed.tech/topics/macos.md>), [Ruby](<https://devfeed.tech/topics/ruby.md>), [Homebrew](<https://devfeed.tech/topics/homebrew.md>), [Jekyll](<https://devfeed.tech/topics/jekyll.md>), [Development](<https://devfeed.tech/topics/development.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [error](<https://devfeed.tech/tags/error.md>), [homebrew](<https://devfeed.tech/tags/homebrew.md>), [issue](<https://devfeed.tech/tags/issue.md>), [jekyll](<https://devfeed.tech/tags/jekyll.md>), [macos](<https://devfeed.tech/tags/macos.md>), [rbenv](<https://devfeed.tech/tags/rbenv.md>), [ruby](<https://devfeed.tech/tags/ruby.md>)

## AI overview

This troubleshooting article explains a Ruby "bad interpreter" error that prevented Jekyll from running after upgrading macOS to Catalina. The author found that Ruby gems were installed with the Homebrew Ruby, but the executable binaries were not linked correctly, and resolved the issue by adding the gems/bin directory to PATH. After a later Big Sur update, the author switched to rbenv because the same fix did not work.

## Source excerpt

Another Catalina rant, this time about Ruby. As far as I know, on MacOS, it is advisable to leave system Ruby version to the OSFor example users don't have write permission on the system's gems folder. , and install a separate version for development. I had one installed via Homebrew, and never had any issues with it. But after Catalina upgrade, I couldn't run Jekyll. Every time it would fail with the following error: $ jekyll -bash: /usr/local/bin/jekyll: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory I checked my bash profile and run which ruby to make sure I'm using the one installed by brew, and everything seemed to be in order. # .bash_profile export PATH="/usr/local/opt/ruby/bin:$PATH" # bash $ which ruby /usr/local/opt/ruby/bin/ruby After quick internet search I learned a lot of people are having similar problems after system upgrade, but I couldn't find the solution. I've tried reinstalling ruby, setting GEM_HOME, altering PATH in /etc/profile and /etc/bashrc, removing and reinstalling gems, but nothing worked. Then I tried to see which Jekyll binary is used and realized - for some reason gems were installed using the correct ruby version, but binaries weren't linked properly. So the solution was pretty easy at the end, all I had to do is to find gems/bin folder and add it to my path. # Use ruby installed by brew export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin/:$PATH" It looks like a common sense, but it took me a couple of hours to figure it out. Hopefully this will save time people facing the same issue. Big Sur update (December 2020) # I got the same error after updating to Big Sur, but this time I couldn't solve it. I still don't know what I was doing wrong. In the end I started using rbenv to manage ruby installations, and it works flawlessly.