RM doesn't offer option to attach gems installed by bundler

I apologize in advance if this is a newbie question / situation.

I am trying to setup Rails3/Ruby-1.9.1 project with RubyMine RM-95.361/2.0.1.  

I have a bundler setup, and I can run "Tools -> Bundler -> Install" and I get this output shown below which installs everything into $HOME/.bundle. The installed gems include rspec and rspec-rails, and looks like it's pulling rspec 2.0.0.beta9

After running "bundle install", I am able to successfully run "rake spec" on the command line, and everything works great:

> rake spec
(in /Users/kig/Coding/dropinmedia/picpo-trunk)


Finished in 12.94 seconds
148 examples, 0 failures

But when I go to RM Ruby SDK and Gems, it's telling me that a lot of the gems are not attached. When I try to attach them, I do not see any way to select Gems installed by bundler.  rspec/rspec rails do not appear in my list.

If I install the gems using "gem install", they do appear, but this seems to be happening for every single gem in my bundle.  Basically RM does not see them and does not offer an option to attach them to the project.

Below is my Gem Environment as reported by the Tools -> Gem Environment command.

Any idea how I can resolve Gem dependencies?

RubyGems Environment:
RUBY VERSION: 1.9.1 (2009-12-07 patchlevel 376) [i386-darwin10.3.0]
INSTALLATION DIRECTORY: /usr/local/ruby-1.9.1/lib/ruby/gems/1.9.1
RUBY EXECUTABLE: /usr/local/ruby-1.9.1/bin/ruby
EXECUTABLE DIRECTORY: /usr/local/ruby-1.9.1/bin
   :update_sources => true
   :verbose => true
   :benchmark => false
   :backtrace => false
   :bulk_threshold => 1000
   :sources => ["http://gems.rubyforge.org/", "http://gems.github.com"]
RubyMine SDK Environment:
Sdk: Ruby SDK 1.9.1 (/usr/local/ruby-1.9.1/bin/ruby)
Sdk Version: ver.1.9.1p376 ( revision 26041)
Ruby Interpreter: /usr/local/ruby-1.9.1/bin/ruby
RVM Sdk: no
Sdk Language Level: 1.9
Sdk Load Path:
Sdk Gem paths:

And output of running bundle install:

/usr/local/ruby-1.9.1/bin/ruby -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) /usr/local/ruby-1.9.1/bin/bundle install
Using rake (0.8.7) from system gems
Using abstract (1.0.0) from system gems
Using builder (2.1.2) from system gems
Using i18n (0.3.7) from system gems
Using memcache-client (1.8.3) from system gems
Using tzinfo (0.3.22) from bundler gems
Using activesupport (3.0.0.beta3) from system gems
Using activemodel (3.0.0.beta3) from system gems
Using erubis (2.6.6) from bundler gems
Using rack (1.1.0) from system gems
Using rack-mount (0.6.6) from bundler gems
Using rack-test (0.5.4) from bundler gems
Using actionpack (3.0.0.beta3) from system gems
Using mime-types (1.16) from system gems
Using polyglot (0.3.1) from system gems
Using treetop (1.4.8) from bundler gems
Using mail (2.2.5) from bundler gems
Using text-hyphen (1.0.0) from system gems
Using text-format (1.0.0) from system gems
Using actionmailer (3.0.0.beta3) from system gems
Using arel (0.3.3) from system gems
Using activerecord (3.0.0.beta3) from system gems
Using activeresource (3.0.0.beta3) from system gems
Using authlogic (2.1.3) from source code at /Users/kig/Coding/dropinmedia/picpo-trunk/vendor/git/authlogic
Using xml-simple (1.0.12) from system gems
Using aws-s3 (0.6.2) from system gems
Using crack (0.1.7) from system gems
Using bitly (0.4.0) from system gems
Using bundler (0.9.26) from system gems
Using diff-lcs (1.1.2) from system gems
Using trollop (1.16.2) from bundler gems
Using gherkin (2.0.2) from bundler gems
Using json_pure (1.4.3) from bundler gems
Using term-ansicolor (1.0.5) from system gems
Using cucumber (0.8.3) from bundler gems
Using daemons (1.1.0) from bundler gems
Using database_cleaner (0.5.2) from bundler gems
Using delayed_job (2.0.3) from bundler gems
Using factory_girl (1.2.3) from source code at /Users/kig/Coding/dropinmedia/picpo-trunk/vendor/git/factory_girl
Using fakeweb (1.2.8) from system gems
Using formtastic (0.9.8) from source code at /Users/kig/Coding/dropinmedia/picpo-trunk/vendor/git/formtastic
Using haml (3.0.0.rc.4) from system gems
Using hashie (0.2.1) from system gems
Using httparty (0.5.0) from bundler gems
Using jnunemaker-crack (0.1.4) from system gems
Using nokogiri (1.4.2) from bundler gems
Using oauth (0.4.1) from system gems
Using pg (0.9.0) from bundler gems
Using thor (0.13.7) from bundler gems
Using railties (3.0.0.beta3) from system gems
Using rails (3.0.0.beta3) from system gems
Using rspec-core (2.0.0.beta.9) from bundler gems
Using rspec-expectations (2.0.0.beta.9) from bundler gems
Using rspec-mocks (2.0.0.beta.9) from bundler gems
Using rspec (2.0.0.beta.9) from bundler gems
Using remarkable (4.0.0.alpha1) from bundler gems
Using remarkable_activemodel (4.0.0.alpha1) from bundler gems
Using remarkable_activerecord (4.0.0.alpha1) from bundler gems
Using webrat (0.7.1) from bundler gems
Using rspec-rails (2.0.0.beta.9.1) from bundler gems
Using sinatra (1.0) from system gems
Using transitions (0.0.7) from system gems
Using yajl-ruby (0.7.6) from system gems
Using twitter (0.9.8) from system gems
Using will_paginate (3.0.pre) from source code at /Users/kig/Coding/dropinmedia/picpo-trunk/vendor/git/will_paginate
Your bundle is complete! Use `bundle show [gemname]` to see where a bundled gem is installed.

Process finished with exit code 0

Comment actions Permalink

I agree. I don't really understand the gem handling of RM. I'd expect, that if you can get the gem list by simply put 'gem list' (or 'sudo gem list') into the command line to get the list of gems which depends on the path to the gem command, that RM uses this list withoud complaining about missing gems.. I use RVM and switch between several rubies and gemsets without problems (outside of RM).

What is the reason for/advantage of explicitly "attach/detach" gems within RM?

If you choose a distinct ruby environment then the RM should check for the corresponding list of gems and use installed gems them without complaning about missing gems if the required gems are installed (via 'bundle install' for instance). RM should only complain about "really" missing gems.

Maybe I'm missing something (too)?

RM 96.552/MacOS X 10.6.4/MacPro 2x2.66GHz Dual-Core Intel Xeon/7GB RAM

Comment actions Permalink

Hubert, as I understand it attaching gems adds them to indexing for the project, so you can use intelligent IDE features.  Adding every single gem installed would not be practical for this reason.  I am fine with this, my only issue is that I could not attach gems that were installed by bundler into my ~/.bundle directory. RubyMine just did not show them in the list of gems I could attach.

Hope this clarifies my post.

Comment actions Permalink

Konstantin, maybe I wasn't clear enough.

Since we declare the required gems within a rails application – using config.gem or Gemfile – and can install them via bundler easily in the latter case, there shouldn't be any reason for "attaching" them within RM again, because they are already "attached" by those declarations, I guess

RM 96.552/MacOS X 10.6.4/MacPro 2x2.66GHz  Dual-Core Int

Comment actions Permalink

There is a lot of fixes corresponding to bundler and git gems on the master. They will be available in the next EAP build.


Please sign in to leave a comment.