Skip to content

CocoaPods plugin for the asdf version manager

License

Notifications You must be signed in to change notification settings

ronnnnn/asdf-cocoapods

Repository files navigation

asdf-cocoapods Build Lint

cocoapods plugin for the asdf version manager.

Contents

Dependencies

  • bash, curl, tar: generic POSIX utilities.
  • Ruby (>= 1.9)
  • Bundler: make downloaded cocoapods binary executable.

Recommendation

Use Ruby and Bundler installed via asdf.

Install

Plugin:

asdf plugin add cocoapods
# or
asdf plugin add cocoapods https://github.com/ronnnnn/asdf-cocoapods.git

cocoapods:

# 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

  1. Set global Ruby version to your project's Ruby version:
asdf global ruby {version}  # Replace {version} with your project's Ruby version
  1. Navigate to your CocoaPods installation directory:
cd ~/.asdf/installs/cocoapods/{version}  # Replace {version} with your installed version
  1. 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)

Contributing

Contributions of any kind welcome! See the contributing guide.

Thanks goes to these contributors!

License

See LICENSE © Seiya Kokushi