Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I'll take a run at this question since I use Chruby and Chgems. I am on Mac OS X, and I have chruby installed via Homebrew. </p> <p>In my <code>.bashrc</code> file:</p> <pre><code>source /usr/local/share/chruby/chruby.sh chruby ruby-2.0.0-p195 </code></pre> <p>The source line is part of <a href="https://github.com/postmodern/chruby#configuration">configuration</a> for Chruby.</p> <p>The second line sets a <a href="https://github.com/postmodern/chruby#default-ruby">default version</a> of Ruby for my system (in my case Ruby 2.0.0). <strong>Note:</strong> As of Chruby 0.3.6 this belongs in <code>.bashrc</code> instead of <code>.bash_profile</code>.</p> <p>In my <code>.bash_profile</code>:</p> <pre><code>source /usr/local/share/chruby/auto.sh </code></pre> <p>This line sets <a href="https://github.com/postmodern/chruby#auto-switching">Auto-switching</a> feature in Chruby.</p> <p>I still have some projects using Ruby 1.9.3 so for those apps I have a <code>.ruby-version</code> file in the root of the app. with one line <code>ruby-1.9.3</code></p> <hr> <p>When you cd into the directory for your app, type <code>chgems</code> and then you can bundle install and what not. You can confirm things are working by entering <code>gem env</code></p> <p>To make my life easier I added .bash_aliases for example: <code>alias myapp='cd ~/Sites/myapp &amp;&amp; chgems'</code></p> <hr> <p>I have been using these together for several months now and really like the combination and yes from what I can tell Chgems does a great job replicating the gemset feature of RVM. I highly recommend you read the docs for both <a href="https://github.com/postmodern/chruby">Chruby</a> and <a href="https://github.com/postmodern/chgems">Chgems</a> projects as this is all covered. In your case, you may not want to set a default Ruby and just use .ruby-version to set it for each app.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload