title: How to fix 'cannot load such file -- socket' error on gem install
body: <p>I'm not able to do <code>gem install</code> of any gem. When I try I get following error message</p>
  
  <pre><code>ERROR:  Loading command: install (LoadError)
      cannot load such file -- socket
  ERROR:  While executing gem ... (NoMethodError)
      undefined method `invoke_with_build_args' for nil:NilClass
  </code></pre>
  
  <p>I use MacOS and <code>rvm</code> for versioning. Also, of note is that reinstall of ruby with openssl didn't work (which is referred as a solution for this problem on some answers on the internet).</p>