I m trying to install Pod on my mac os (os version is big sure), and I m using Xcode 13.1
I m trying to install Pod with this command from terminal:
sudo pod install
then the system ask me password, after that I can see this error in terminal line:
Traceback (most recent call last):
16: from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1370:in `activate'
11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `activate_dependencies'
10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `each'
9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1406:in `block in activate_dependencies'
8: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1370:in `activate'
7: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `activate_dependencies'
6: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `each'
5: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1406:in `block in activate_dependencies'
4: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1370:in `activate'
3: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `activate_dependencies'
2: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `each'
1: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1400:in `block in activate_dependencies'
/Library/Ruby/Site/2.6.0/rubygems/dependency.rb:311:in `to_specs': Could not find 'minitest' (>= 5.1) among 39 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/michelecastriotta/.local/share/gem/ruby/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.11.2_1/libexec' , execute `gem env` for more information
16: from /usr/local/Cellar/cocoapods/1.11.2_1/libexec/bin/pod:23:in `<main>'
15: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `activate_bin_path'
14: from /Library/Ruby/Site/2.6.0/rubygems.rb:285:in `synchronize'
13: from /Library/Ruby/Site/2.6.0/rubygems.rb:286:in `block in activate_bin_path'
12: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1370:in `activate'
11: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `activate_dependencies'
10: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `each'
9: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1406:in `block in activate_dependencies'
8: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1370:in `activate'
7: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `activate_dependencies'
6: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `each'
5: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1406:in `block in activate_dependencies'
4: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1370:in `activate'
3: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `activate_dependencies'
2: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1388:in `each'
1: from /Library/Ruby/Site/2.6.0/rubygems/specification.rb:1399:in `block in activate_dependencies'
/Library/Ruby/Site/2.6.0/rubygems/specification.rb:1402:in `rescue in block in activate_dependencies': Could not find 'minitest' (>= 5.1) among 39 total gem(s) (Gem::MissingSpecError)
Checked in 'GEM_PATH=/Users/michelecastriotta/.local/share/gem/ruby/2.6.0:/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/gems/2.6.0:/usr/local/Cellar/cocoapods/1.11.2_1/libexec' at: /usr/local/Cellar/cocoapods/1.11.2_1/libexec/specifications/activesupport-6.1.4.1.gemspec, execute `gem env` for more information
how can I do to install pod on my mac?
I faced a similar issue, by default system ruby version is being used, we need to bypass it and then continue with cocoa pods.
Install ruby using homebrew
brew install ruby
By default, binaries installed by gem will be placed into: /usr/local/lib/ruby/gems/2.7.0/bin
You may want to add this to your PATH.
ruby is keg-only, which means it was not symlinked into /usr/local, because macOS already provides this software and installing another version in parallel can cause all kinds of trouble.
If you need to have ruby first in your PATH run (and replace user_name
with your username):
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/user_name/.bash_profile
For compilers to find ruby you may need to set:
export LDFLAGS="-L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/ruby/include"
Follow the instructions to set PATH. Replace user_name
with your username
echo 'export PATH="/usr/local/opt/ruby/bin:$PATH"' >> /Users/user_name/.bash_profile
echo 'export LDFLAGS="-L/usr/local/opt/ruby/lib"' >> ~/.bash_profile
echo 'export CPPFLAGS="-I/usr/local/opt/ruby/include"' >> ~/.bash_profile
source ~/.bash_profile
Check your path
ruby -v
ruby 3.1.1p18 (2022-02-18 revision 53f5fc4236) [x86_64-darwin20]
user@MacBook-Air ios % which ruby
/usr/local/opt/ruby/bin/ruby
That's it, ruby version is all set Install cocoa pods then you are good to go
sudo gem install -n /usr/local/bin cocoapods
just try reinstalling the missing gem minitest
mentioned in that error message like this:
gem install minitest -v 5.1.0
this should solve your current problem but you may have more errors for other missing gems. in that case, check your message for things like Could not find 'minitest' (>= 5.1)
and try installing them.
if you are overwhelmed by too many of these missing gem errors, try uninstalling cocopods and then re-installing it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With