bundle exec pod install error
2 min readNov 10, 2021
Scenario
bundle exec pod install
- Returns below error
Could not find unf_ext-0.0.8 in any of the sources
Before jumping on to solution, let’s what’s bundle & why we need them ?
- What are the advantages of performing `pod install` vs `bundle exec pod install`
- what is bundler ?
Bundler
- Bundler creates a consistent application environment for your application, by allowing you to specify the version of libraries.
- We took this idea almost whole-sale for CocoaPods. You define a Gemfile that says what libraries you want to include, and can optionally specify a version or range.
- You run
bundle install
and it will generate a Gemfile.lock (similar to Podfile.lock)saying the exact version of all of your libraries and then anyone else runningbundle install
with that project gets the exact same versions. - Bundler will generate
Gemfile.lock
, whose purpose is pretty similar toPodfile.lock
in cocoapods universe. Actually, Podfile / Podfile.lock and the whole cocoapods concept was strongly inspired by bundler and rubygems, so historically they were in place even earlier - Read more here
advantages of using bundle exec pod install
- Consistency across all your environments — development, staging, production, whatever more you have. Bundler gives your a guarantee, that software that worked on your environment will work on remote environment sharing the same
Gemfile
andGemfile.lock
(so in case it’s not yet obvious commit them to your version control) - Easy versions change. Playgrounds not working with cocoapods 1.5.2?
gem "cocoapods", "1.4.0", bundle install, bundle exec pod install, Cmd+B
Wanna check whether project works on cocoapods-prerelease?gem "cocoapods", "1.5.0.beta.1"
. Issue arised on a latest fastlane?gem "fastlane", "2.94.0"
- In advance to p.1, you and your project fellows stop fighting pod install diffs from different cocoapods versions, just because you share
Gemfile / Gemfile.lock
and have the same development environment.
Solution
Could not find unf_ext-0.0.8 in any of the sources
- Install bundle without production
bundle install --without production
- If you get error still as below;
An error occurred while installing unf_ext (0.0.8), and Bundler cannot continue.
Make sure that `gem install unf_ext -v '0.0.8' --source 'https://rubygems.org/'` succeeds before bundling.
- Install missing
coreutils
brew install coreutils
- Additionally, you might still get Gem::FilePermissionError
While executing gem ... (Gem::FilePermissionError)
You don't have write permissions for the /Library/Ruby/Gems/2.6.0 directory.
- Install bundler at `/usr/local/opt/ruby/bin`
sudo gem install -n /usr/local/bin bundler
- Now, if you get error as unf_ext (0.0.8), and Bundler cannot continue.
- Ref: https://mkang32.github.io/2020/12/14/ruby-big-sur.html