Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

CocoaPods not working in macOS High Sierra

After upgrading to macOS High Sierra CocoaPods is not working. While it is tempting to move away from CocoaPods, it's unfortunately not in scope right now. The error message is below.

zsh: /Users/****/.gems/bin/pod: bad interpreter: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin: no such file or directory

I realize that the error stems from Ruby being upgraded but what is the easies fix? Trying to make CocoaPods use the new ruby version yields other errors.

Edit: For now i installed Ruby 2.0 with rvm install 2.0.0 and rvm use 2.0.0 and then reinstalled CocoaPods sudo gem install cocoapods. Seems to be working now.

like image 837
Maciej Swic Avatar asked Oct 17 '22 07:10

Maciej Swic


People also ask

Do I need Ruby for CocoaPods?

To be able to work with CocoaPods, you need to specify the path to the Ruby SDK and install the CocoaPods gem.


4 Answers

According to https://github.com/CocoaPods/CocoaPods/issues/6778 reinstalling CocoaPods should solve this issue:

sudo gem install cocoapods
like image 418
zeisi Avatar answered Oct 23 '22 09:10

zeisi


After upgrading to macOS High Sierra, get it fixed with following commands:

sudo gem update --system
sudo gem install -n /usr/local/bin cocoapods

once it will be finished then write below command:

pod install

This solution has worked for me...!!!

like image 118
mital solanki Avatar answered Oct 23 '22 09:10

mital solanki


I got this error while installing the CocoaPods

ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /usr/bin directory.

And I used this statement. It worked!

sudo gem install cocoapods -n /usr/local/bin
like image 30
Danh Huynh Avatar answered Oct 23 '22 10:10

Danh Huynh


This worked for me, although I had to do

sudo gem install cocoapods
like image 12
Andrew Smith Avatar answered Oct 23 '22 10:10

Andrew Smith