简体   繁体   中英

Pod install not working in react-native mac os catalina 10.15

Error: System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby: bad interpreter: No such file or directory

in mac os catalina

You can fix it by running

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

I face the same problem on Catalina and tried these 2 steps hopefully it will work

brew install cocoapods --build-from-source

brew link --overwrite cocoapods

Run the following command in terminal

sudo gem install cocoapods

For more details follow this link.

https://github.com/CocoaPods

This solution worked for me.

1) Go to Xcode preferences -> Locations 'tab'. See image for Locations 'tab'.

2) Check the Command Line Tools section. If it's blank, make sure your current command line tools is selected. See image for Command Line Tools Section.

3) Run sudo gem install -n /usr/local/bin cocoapods

It worked like a charm for me. Hope it does for someone else too. Happy coding!

None of the suggestions worked for me. The issue could only be resolved by adding the correct Ruby path in the profile such as:

export PATH="/usr/local/opt/ruby/bin:/usr/local/lib/ruby/gems/2.6.0/bin/:$PATH"

I solved it like this

1) cd ~/.cocoapods

2) rm -r repos

3) sudo gem install cocoapods

4) pod install

Maybe try using the cocoapods installed through homebrew. It works for me. – Snowfish

This comment by Snowfish on the question helped me using cocoapods.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM