title: How to set up Ruby on OS X with Nix instead of Homebrew?
body: <p>I switched recently to the Nix package manager instead of Homebrew for OS X. </p>
  
  <p>Usually, I install it with rbenv like:</p>
  
  <pre><code>brew install rbenv
  rbenv install 2.2.0
  </code></pre>
  
  <p>I am asking myself now how does one do it with Nix? I've heard Nix itself is a good enough package manager, so maybe I can get rid of <code>rbenv</code> for handling my ruby version?</p>
  
  <p>When I install ruby via Nix</p>
  
  <pre><code>nix-env -i ruby
  </code></pre>
  
  <p>Even when OS X recognises it:</p>
  
  <pre><code>$ which ruby
  /Users/USERNAME/.nix-profile/bin/ruby
  </code></pre>
  
  <p>I am still getting a <code>Permission denied</code> error when trying to:</p>
  
  <pre><code>gem install sass
  </code></pre>
  
  <blockquote>
    <p>Would you still recommend rbenv for handling ruby installations? I
    know I could just chown the Nix folder, but I should own it anyway.</p>
  </blockquote>