[SOLVED] Sửa lỗi can’t find gem cocoapods (>= 0.a)… khi chạy pod install

pod insall 
/usr/local/Cellar/ruby/3.1.1/lib/ruby/3.1.0/rubygems.rb:265:in `find_spec_for_exe': can't find gem cocoapods (>= 0.a) with executable pod (Gem::GemNotFoundException)
	from /usr/local/Cellar/ruby/3.1.1/lib/ruby/3.1.0/rubygems.rb:284:in `activate_bin_path'
	from /usr/local/bin/pod:23:in `<main>'

keywords: xcode, cocoapods, ios development, install

Lỗi can’t find gem cocoapods

Cách sửa: Cài lại cocoapods

⇒  brew uninstall cocoapods
⇒  brew install cocoapods  

Nếu thấy báo lỗi:

Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
Could not symlink bin/pod
Target /usr/local/bin/pod
already exists. You may want to remove it:
  rm '/usr/local/bin/pod'

To force the link and overwrite all conflicting files:
  brew link --overwrite cocoapods

To list all files that would be deleted:
  brew link --overwrite --dry-run cocoapods

Possible conflicting files are:
/usr/local/bin/pod
/usr/local/bin/xcodeproj

Thì chạy lệnh: brew link –overwrite cocoapods

brew link --overwrite cocoapods

Kết quả:

nguồn: nttnhan.com

Loading

What’s your Reaction?
+1
1
+1
0
+1
2

Leave a Reply

Your email address will not be published. Required fields are marked *