Ruby Version Manager
You might encounter the following error when you try to do gem install ERROR : While executing gem ... (NoMethodError) undefined method `request' for nil :NilClass [ @failed_dep .dependency, @activated .request.dependency] ^^^^^^^^ The error was produced because of the mismatched version of Ruby. To resolve this error, you can download a Ruby version manager. In this case, I use rbenv If you have homebrew installed, you can type this code brew install rbenv in the terminal After installing, check the current ruby version, ruby -v Check the path, which ruby Run the following to change the path (replace YOUR_USERNAME with your user name, in my case woodylin@woodys-air ~ % woodylin is my username.) export PATH="/Users/YOUR_USERNAME/.rbenv/shims:$PATH" export PATH="/Users/woodylin/.rbenv/shims:$PATH" Check the path again, which ruby Install the desired version, in my case, rbenv install...