pod install cdn_source.rb:342:in `download_file_async': undefined method `encode' for URI:Module

1.7k Views Asked by At

While trying to do "pod install" in react-native project , I am getting below error:

/Users/admin/.rvm/rubies/ruby-3.0.0/lib/ruby/gems/3.0.0/gems/cocoapods-core-1.9.3/lib/cocoapods-core/cdn_source.rb:342:in download_file_async': undefined method encode' for URI:Module (NoMethodError)

Cocoapods - 1.9.3 Ruby - 3.0.0 OSX - 11.5 Xcode - 12.2

2

There are 2 best solutions below

0
On

Below versions fixed the issue. Issue looks like its due to cocoapods and Ruby version compatibility:

Ruby - 2.7.1 cocoapods - 1.9.3

0
On

Check if you set any path for ruby in /etc/path and if there is any try to remove it and test again