Bundler is the official Gems environment provider in RubyMine

Eugene Toporov

There’s been one quite major change in RubyMine 3.2 that was not really advertised — gems management changes.

We decided to remove a part of our own code in favor of using Bundler. Because Bundler is really the best way to manage the dependencies. So, why re-invent the wheel?

You still have the full UI for browsing gem repositories, installing and updating gems from inside the IDE. The main change is that you no longer attach gems to your projects as you did before.

If you are already using Bundler for managing your gems, RubyMine will figure it out automatically and load the gem requirements from the Gemfile.

If there is no Bundler, RubyMine scans all the project files for calls to Ruby gems and produces a set of the required gems. If for some reason you are not happy with the set of gems defined by RubyMine, you can create a Gemfile yourself and specify the gems of your choice. Just launch Tools | Bundler | Init from the main menu and you’ll have a Gemfile to start with.

It is fun to edit Gemfile in RubyMine

Also, once you open a Gemfile you can see what gems are missing or need to be updated:

and you can install them right from here using the quick-fix (Alt-Enter)

And that’s basically it.

Do you wonder why you need to bother at all? Pretty simple — if RubyMine sees all gems that you use in your code, you can navigate to the gem code, see the docs for gem methods, and of course have accurate code completion. And the reason why RubyMine does not index all of the gems that you have installed, regardless of whether you use them or not, is very simple: performance.

Develop with pleasure!
The RubyMine Team

Comments below can no longer be edited.

5 Responses to Bundler is the official Gems environment provider in RubyMine

  1. Brendon McLean says:

    July 8, 2011

    This is the best change you’ve made to Rubymine since it’s release.

  2. grosser says:

    July 8, 2011

    Id like to opt-out of loading all the stuff thats in my gemfile, because of said performance (Rubymine hangs a lot ‘processing’ as it is…), hope this is still possible.

  3. Lance says:

    August 7, 2011

    Any idea what causes this?

    sudo: no tty present and no askpass program specified

  4. Eugene Toporov says:

    August 8, 2011

    @Lance, this is not supported in RubyMine. A feature request is welcome at http://youtrack.jetbrains.net/issues/RUBY

  5. Michael Pelz-Sherman says:

    October 19, 2011

    I’m having a problem running my rspec tests with RubyMine on a project that was not developed originally with RubyMine. As each new gem dependency is encountered, I get a new error message about missing dependencies, e.g.:

    /Users/msherman/.rvm/gems/ree-1.8.7-2011.03/gems/bundler-1.0.18/lib/bundler/spec_set.rb:88:in `materialize’: Could not find [gem name-version] in any of the sources (Bundler::GemNotFound)

    I’ve been using the Gem manager to install the missing gems one by one, but this is taking forever! Isn’t this what bundler is supposed to do automatically? What am I missing here?

    – Michael


Subscribe for updates