Closed houmie closed 2 years ago
Are you using a Gemfile in your project directory? You may need to add cocoapods-keys as a dependency there.
Hi @ashfurrow
Thank you for your reply.
No Gemfile in my project file.
Here is my .zshrc in case I did something wrong:
export ZPLUG_HOME=/usr/local/opt/zplug
source $ZPLUG_HOME/init.zsh
export ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR=/usr/local/share/zsh-syntax-highlighting/highlighters
source /usr/local/share/zsh-syntax-highlighting/zsh-syntax-highlighting.zsh
export PATH="$HOME/.pyenv/bin:$PATH"
export PATH="/usr/local/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/zlib/lib -L/usr/local/opt/bzip2/lib -L/usr/local/opt/openssl@3/lib -L/usr/local/opt/ruby/lib"
export CPPFLAGS="-I/usr/local/opt/zlib/include -I/usr/local/opt/bzip2/include -I/usr/local/opt/openssl@3/include -I/usr/local/opt/ruby/include"
eval "$(pyenv init -)"
eval "$(pyenv virtualenv-init -)"
export PATH="/usr/local/opt/openssl@3/bin:$PATH"
export PKG_CONFIG_PATH="/usr/local/opt/openssl@3/lib/pkgconfig"
export PATH="/usr/local/opt/ruby/bin:$PATH"
eval "$(rbenv init -)"
Gotcha, that context is helpful.
So you basically have two options for how to proceed. You can either dig deeper into your system's Ruby installation and gems and whatnot, which you don't sound keen on, or you can use a Gemfile. Ruby uses a tool called Bundler to kind of scope a set of gems (at specific versions) to a project. After setup, you use bundle exec pod install
instead of just pod install
to force the Gemfile's gems to get used.
The steps I would take are:
gem install bundler # Install Bundler globally
bundle init # Generate a Gemfile
echo "gem 'cocoapods'" >> Gemfile # Add CocoaPods
echo "gem 'cocoapods-keys'" >> Gemfile # Add CocoaPods-Keys
bundle install # Install the gems
bundle exec pod install
This will also create a Gemfile.lock
file that locks the gems to their current versions.
Of course, there's not guarantee this will work, but it's what I would suggest trying next. Using a Gemfile is very conventional on Ruby projects and, in my experience, helps avoid the kinds of problems you've reported.
Good luck and let us know 👍
Yes, it works!!!! Thank you so much!
Is there any chance this could be done via brew in future instead of gem, just an idea to ease the pain, not sure if possible. :-)
Awesome, glad it worked 👍 It's unlikely we could replicate this setup with homebrew because CocoaPods is a Ruby gem, and gems are the right tool for CocoaPods plugins. I promise that Ruby isn't so bad! It can just be intimidating at first.
Dear all,
As you can see despite the gem being installed, Pod can't be installed.
Please help me, I hate Ruby. I'm completely stuck.