You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Show all installable versions
asdf list-all cocoapods
# Install specific version
asdf install cocoapods latest
# Set a version globally (on your ~/.tool-versions file)
asdf global cocoapods latest
# Now cocoapods commands are available
pod --version
Check asdf readme for more instructions on how to
install & manage versions.
Troubleshooting
Incompatibility Errors After Updating Ruby
If you encounter errors like the following after updating your Ruby version and running pod, it's likely due to a dependency mismatch:
~/.asdf/installs/cocoapods/1.15.2/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.4/lib/bigdecimal.rb:4:in `require': linked to incompatible ~/.asdf/installs/ruby/3.3.3/lib/libruby.3.3.dylib - ~/.asdf/installs/cocoapods/1.15.2/vendor/bundle/ruby/3.3.0/gems/bigdecimal-3.1.4/lib/bigdecimal.bundle (LoadError)
CocoaPods uses Bundler to manage its dependencies. When you change Ruby versions, you need to redownload these dependencies to ensure compatibility.
Resolution
Set global Ruby version to your project's Ruby version:
asdf global ruby {version} # Replace {version} with your project's Ruby version
Navigate to your CocoaPods installation directory:
cd~/.asdf/installs/cocoapods/{version} # Replace {version} with your installed version
Redownload and reinstall the dependencies:
bundle install --redownload
Now you should be able to run pod commands without errors.
If you still encounter issues, try reinstalling Ruby, Bundler, and CocoaPods.
See also: #7 (comment)