title: Rails Starting Up With Wrong Version of Ruby
body: <p><strong>TLDR: How do I force a rails app to use the correct ruby interpreter?</strong></p>
  
  <p>Hello,</p>
  
  <p>Something hosed parts of my Ruby 1.9.2p290 install (certain classes just went missing one day), so I removed it and attempted to reinstall the environment. </p>
  
  <p>I'm running on Snow Leopard.</p>
  
  <p>Ruby 1.9.2 was installed from source. (I tried to install via MacPorts and it would fail). I am not keen on RVM as I use bundler and I seem to recall some problems with how bundler and RVM interact, though from what I can tell RVM works.</p>
  
  <p>After reinstalling a few gems I noticed they were being placed in a gem folder for Ruby 1.8. "This is weird," I thought.</p>
  
  <p>Starting up the rails app, I notice a lot of weird exceptions being thrown regarding syntax. After printing RUBY_VERSION to stdout, I noticed that the Rails app is running 1.8.7.</p>
  
  <p><code>which ruby</code> shows only one ruby interpreter:</p>
  
  <pre><code>$ which ruby
  /usr/bin/ruby
  $ /usr/bin/ruby -v
  ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin10.8.0]
  </code></pre>
  
  <p>If I open up Activity Monitor, the ruby process from the Rails app lives at <code>/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby</code>, which I believe is the ruby interpreter that OSX shipped with.</p>
  
  <p>I haven't found any information on completely purging Ruby from OSX. I would love to do that then simply install ruby from source.</p>
  
  <p>It seems there are two problems:</p>
  
  <ul>
  <li>Rails is running a ruby interpreter that I have no idea how it is calling, when I need it to run the 1.9.2 interpreter installed from source</li>
  <li>gems are being installed in a 1.8 folder, I suspect because gem thinks its running under 1.8</li>
  </ul>
  
  <p>How do I fix this?</p>
  
  <p>Thank you,</p>
  
  <p>Tom</p>