13

I updated my macOS to High Sierra, Now installing dependencies through cocoapods in my iOS application. But I face the following error.

XXXXXXXXX:MyProject CompanyName$ pod update 
-bash: /usr/local/bin/pod: /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby: bad interpreter: No such file or directory

Than i tried

 Zubair-mac-mini:~ sdsol$ gem install cocoapods

 ERROR:  While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.
Zubair-mac-mini:~ sdsol$

any help would be greatly appreciated.

Nisar Ahmad
  • 885
  • 1
  • 10
  • 25
  • See [here](https://stackoverflow.com/questions/31442214/running-pod-set-up-gives-me-bad-interpreter-no-such-file-or-directory) – Kerberos Sep 28 '17 at 13:59

5 Answers5

55

I had the same problem after upgrading to macOS High Sierra and got it fixed with following commands (note, you need to use sudo to run as super user):

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

Good luck!

ingdc
  • 760
  • 10
  • 16
marknote
  • 1,058
  • 8
  • 10
4

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

sudo gem install cocoapods
1

Finally I found a solution after a lot of search.

1: Update your terminal to the latest version.

2: Download and Update RubyGems to the latest version from: https://rubygems.org/pages/download

3: Thin I update my pod file. through pod update.

Nisar Ahmad
  • 885
  • 1
  • 10
  • 25
0

Add

eval "$(rbenv init -)" to ~/.bash_profile file

Vinh Huynh
  • 151
  • 1
  • 5
-2
sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer
Hitesh Chauhan
  • 1,520
  • 15
  • 16