running pod set up gives me “bad interpreter: No such file or directory”

不羁的心 提交于 2019-11-30 10:52:18

问题


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 directory

I followed Ray Wenderlich's guide to install cocoapods and i get this issue so i have no idea what is going on.


回答1:


I encountered this problem when upgrading to Mac OS High Sierra.

This was my fix:

sudo gem install cocoapods

I found this answer on the CocoaPods issue list on Github.




回答2:


After upgraded to High Sierra, I got the same error, just reinstalled the cocoapods

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



回答3:


Same issue I was facing when I updated our system from Sierra to Mojave. Also works for Catalina

The following steps worked:

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

I got the help from the following link.




回答4:


This happened when I upgraded to Catalina. I solved it by running:

sudo gem install -n /usr/local/bin ruby
sudo gem install -n /usr/local/bin cocoapods



回答5:


i fixed it by running brew install ruby




回答6:


brew link --overwrite cocoapods

This line saved my day.




回答7:


While I'm trying to install again then I got another error saying that

ERROR: While executing gem ... (Gem::FilePermissionError) You don't have write permissions for the /Library/Ruby/Gems/2.3.0 directory.

Then I did this and worked fine.

sudo gem uninstall cocoapods

sudo gem install cocoapods



回答8:


On my mac this solved the problem:

brew uninstall cocoapods

brew install cocoapods



回答9:


Fixed with

brew upgrade cocoapods



回答10:


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




回答11:


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'.



来源:https://stackoverflow.com/questions/31442214/running-pod-set-up-gives-me-bad-interpreter-no-such-file-or-directory

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!