recently tried to do pod setup
and i get this:
-bash: /usr/local/bin/pod: /usr/local/opt/ruby/bin/ruby: bad interpreter: No such file or directo
The "rubyist approved" way of doing this is to install a ruby version manager (rbenv) and install cocoapods through that. Messing with sudo
and your rubygems is going to lead to tears.
Tried most of the answers but none worked. If the above doesn't work try Opening Xcode preferences > Locations > selecting Command Line Tools to Xcode. Then install cocoapods
sudo gem install -n /usr/local/bin cocoapods
After upgrading from OS X Mojave to OS X Catalina I received this message when running pod init
or pod --version
:
-bash: /Users/mangolassi/.gem/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory
I don't like the idea of sudo gem install cocoapods
so I have my .cocoapods folder in my user directory and I've modified my .bash_profile to point to it. The error I received was because the version 2.3 was hard coded in this file:
/Users/eric/.gem/bin/pod
and Catalina came with 2.6.
It's possible that using sudo install would overwrite this file successfully, and probably does, but I wanted to keep my original setup.
I was able to to just modify the first shebang line of the file /Users/eric/.gem/bin/pod
to have a path with 2.6 instead of 2.3 and it worked. The entire change was changing the '3' to a '6' in my chase as the version was still '2'.
On my mac this solved the problem:
brew uninstall cocoapods
brew install cocoapods
In my case nothing of the above worked. I had ruby 2.3.0 installed and I had to downgrade to 2.0.0:
gem update --system 2.0.0
brew link --overwrite cocoapods
This line saved my day.