RVM + Bundler + RubyMine

On my current project, we needed to be able to use RVM with Bundler but we want access to our bundled gems from Rubymine.

You’re going to want to write an alias in your .bashrc/.zshrc/.whatevershrc for this one. You can use most of the below:

export PROJECT_PATH=the_path_to_your_Rails_project_using_bundler_goes_here
alias rubymine="rvm ruby-1.8.6-tv1_8_6_287 ;\
export GEM_HOME=#{PROJECT_PATH}/vendor/bundler_gems/ruby/1.8;\
export GEM_PATH=${GEM_HOME};/Applications/RubyMine\ 2.0.1.app/Contents/MacOS/rubymine"

What we’re doing here:

  1. We then override the gem repo to point to our bundled gems (which are conveniently formatted as a gem repo)
  2. Then we fire up Ruby Mine with the above environment (Thanks to Brennan Dunn here).

Now close and reopen your shell.

From there, you go into RubyMine’s settings, click on “Add SDK”…

… unhide the hidden directories like so…

… then navigate to your Ruby VM and hit OK:


Posted by evan on Friday, January 29, 2010

blog comments powered by Disqus