title: How to install Vagrant as a $HOME gem, using Mac's Ruby interpreter (1.8)?
body: <p>I've already asked about <a href="https://stackoverflow.com/questions/7143077/use-pip-and-install-packages-at-my-home-folder">installing python packages at $HOME</a>. It worked flawlessly.</p>
  
  <p>Now, I'm planning to install <a href="http://vagrantup.com" rel="nofollow noreferrer">Vagrant</a>. It's a <a href="http://rubygems.org/" rel="nofollow noreferrer">gem</a> (a ruby package), and I would like to install it in my $HOME folder as well but I'm not used to it so I'm asking for help here.</p>
  
  <p>I've already run,</p>
  
  <pre><code>sudo gem update --system
  </code></pre>
  
  <p>As followed by their <a href="http://vagrantup.com/docs/getting-started/setup/mac.html" rel="nofollow noreferrer">mac tutorial</a>. And when I try to install Vagrant using their recomendation:</p>
  
  <pre><code>gem install vagrant
  </code></pre>
  
  <p>I get:</p>
  
  <pre><code>ERROR:  While executing gem ... (Gem::FilePermissionError)
      You don't have write permissions into the /usr/bin directory.
  </code></pre>
  
  <p>(It's strange that just <code>gem install vagrant</code> doesn't work, I followed the guide from Vagrant's official website in a vanilla installed Mac, never used Ruby here and I got the error. Specially when using sudo <a href="http://groups.google.com/group/vagrant-up/browse_thread/thread/30334a4c5191b7f8/037439bca1a0048d" rel="nofollow noreferrer">is not required</a>.)</p>
  
  <p>Ok. Using sudo is going to resolve it, but I don't want to install this gem system wide, I want to install them at $HOME like I did with pip - and I have no idea how I can do it without messing up with this mac machine. Can someone help me how to do it the best way? Which variables to I have to export, if I have to add <code>~/.gem</code> to my <code>$PATH</code>, or something like that. (Did I already messed everything up when I used <code>sudo gem update --system</code>?)</p>
  
  <p>Some people are suggesting to use <a href="http://beginrescueend.com/" rel="nofollow noreferrer">rvm</a>, but I think this is overkill since I'm not going to develop ruby applications against the system Ruby, I just want to run Vagrant. Of course, if there isn't another way, I'm going to use it.</p>
  
  <p>My gem environment command outputs:</p>
  
  <pre><code>gem environment
  RubyGems Environment:
    - RUBYGEMS VERSION: 1.8.10
    - RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
    - INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
    - RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
    - EXECUTABLE DIRECTORY: /usr/bin
    - RUBYGEMS PLATFORMS:
      - ruby
      - universal-darwin-10
    - GEM PATHS:
       - /Library/Ruby/Gems/1.8
       - /Users/user/.gem/ruby/1.8
       - /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
    - GEM CONFIGURATION:
       - :update_sources =&gt; true
       - :verbose =&gt; true
       - :benchmark =&gt; false
       - :backtrace =&gt; false
       - :bulk_threshold =&gt; 1000
    - REMOTE SOURCES:
       - http://rubygems.org/
  </code></pre>
  
  <p><strong>EDIT</strong>: I've found a <a href="http://www.stuartellis.eu/articles/installing-ruby/#homedir-gems" rel="nofollow noreferrer">tutorial</a>, that says that I need just to add to my <code>.profile</code>:</p>
  
  <pre><code>export GEM_HOME=$HOME/.gems
  export PATH=$GEM_HOME/bin:$PATH
  </code></pre>
  
  <p>Is it safe to use this approach?</p>