I'm having difficulties getting RubyMine to see my gems properly. The problem I'm seeing is that the editor screen does not recognise any classes for any gems eg for MyClass < ActiveRecord::Base, I see a yellow warning: Cannot find 'ActiveRecord'
.
I'm using bundler and I have my gems configured per project and installed in /some/project_dir/.bundle/gems
I've seen this bug: http://youtrack.jetbrains.com/issue/RUBY-14542, so I'm attempting to work round this by launching RubyMine as follows:
GEM_HOME="/some/project_dir/.bundle/gems/ruby/1.8" mine
My RubyGems environment looks correct - here is the relevant extract:
....
Sdk Gem paths:
~/.rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/gems
/some/project_dir/.bundle/gems/ruby/1.8/gems
~/.rbenv/versions/ree-1.8.7-2012.02/lib/ruby/gems/1.8/bundler/gems
/some/project_dir/.bundle/gems/ruby/1.8/bundler/gems
Gems used for 'project':
rails (bundled)
/some/project_dir/.bundle/gems/ruby/1.8/bundler/gems/rails-857c6ee62c05
rspec (bundled(1.3.2))
/some/project_dir/.bundle/gems/ruby/1.8/gems/rspec-1.3.2
....
So it appears that it is using the correct path for the gems:
/some/project_dir:ls -1 /some/project_dir/.bundle/gems/ruby/1.8/gems
Ascii85-1.0.1
Ascii85-1.0.2
GeoRuby-1.3.3
abstract-1.0.0
....
I see the gems listed under the Ruby SDK and Gems preferences pane, but the editor pane doesn't recognise any files from within them.
This seems like a similar issue, but I still see problems even using the workaround specified.
Update: I upgraded from rails 2.3 to rails 3.0 (by upgrading the Gemfile and running bundle install), I am now able to see the rails source in the editor, but none of the other gems. Rails is installed with the :github=> directive:
gem 'rails', :github => 'rails/rails', :branch => '3-0-stable'
So I'm thinking this might be something to do with it.
Cross posted to this bug: http://youtrack.jetbrains.com/issue/RUBY-14542