Can't install gems because "undefined method `invoke_with_build_args' for nil:NilClass" Can't install gems because "undefined method `invoke_with_build_args' for nil:NilClass" ruby ruby

Can't install gems because "undefined method `invoke_with_build_args' for nil:NilClass"


I found that although I already had openSSL installed I needed to brew upgrade ruby before it was recognized. Another maze of twisty little passages, all alike.


It looks like you need to install OpenSSL first.So try to install it:

$ brew install openssl

And then you need to recompile ruby with OpenSSL:

$ CONFIGURE_OPTS="--with-openssl-dir=brew --prefix openssl" rbenv install 2.1.1-p76


When I checked my

rbenv local

and

rbenv global 

they we different.

So I set

rbenv local 2.6.5

and it resolved my issue