You don't have write permissions for the /usr/bin directory. while installing Cocoapods : <p>I'm trying to install Cocoapods using the following command on my Mac:</p>

<pre><code>sudo gem install cocoapods
</code></pre>

<p>But I'm getting the following error:</p>

<pre><code>ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions for the /usr/bin directory.
</code></pre>

<p>Really doesn't make sense as I'm doing is via sudo as the root user. Any help will be appreciated!</p>

<p>I'm using gem version 2.7.7 (latest as of today).</p>
