Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to address error installing cocoapods (undefined method `invoke_with_build_args' for nil:NilClass)?

I run

sudo gem install cocoapods

but I receive the following error. I'm trying to follow the instructions at Cannot Install Cocoapods - No podfile found in the project directory but am getting stuck because I can't get past this step.

Any advice on what I would do?

ERROR:  Loading command: install (LoadError)
    dlopen(/Users/sharatakasapu/.rbenv/versions/2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle, 9): Library not loaded: /usr/local/opt/openssl/lib/libssl.1.0.0.dylib
  Referenced from: /Users/sharatakasapu/.rbenv/versions/2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
  Reason: image not found - /Users/sharatakasapu/.rbenv/versions/2.4.0/lib/ruby/2.4.0/x86_64-darwin16/openssl.bundle
ERROR:  While executing gem ... (NoMethodError)
    undefined method `invoke_with_build_args' for nil:NilClass
like image 449
sharataka Avatar asked May 08 '20 11:05

sharataka


1 Answers

I was finally able to move forward using info from this site to simply upgrade to a new version of rbenv: https://qiita.com/nya__str/items/eeddac3a122f0c251d88

# view versions available to install
rbenv install --list

# pick the latest version from the list and install it
rbenv install 2.7.2

# set as the new default
rbenv global 2.7.2

# try again
sudo gem install cocoapods

# 💥 😅 🚀
like image 157
monalisa717 Avatar answered Oct 16 '22 12:10

monalisa717