Viewing Gems in External Libraries

I'd like to view the source of my installed gems in the External Libraries tree.  Is this possible?  Here is my setup and what I'm seeing:

I'm running build RM-112.49 on Windows.
I pointed RubyMines to my Ruby 192 MRI installation that RubyInstaller installed.  In the Ruby SDK and Gems project setting page, the correct Ruby interpreter is selected (C:\Ruby192\bin\ruby.exe) and the correct list of installed gems is displayed.  Snap:

Settings_2011-12-02_11-14-45.png

However, I don't understand what the Project pane under External Libraries is displaying.  Snap:

BTR - [CBTR] - ...test2.rb - JetBrains RubyMine (EAP) RM-112.49_2011-12-02_11-15-51.png
I can't find the gems in any subfolder.  Is Ruby192 unsupported?

4 comments

Hello Luis,

currently gemset of an application is picked up from Gemfile or gem calls across your project. To make gems show up in external libraries you can simply create Gemfile with needed gems (you can find information about this in our help section)

0

Thank you, Dennis, creating a Gemfile did get RubyMine to display the gem sources in the External Libraries tree:

Gemfile:
BTR - [CBTR] - ...Gemfile - JetBrains RubyMine (EAP) RM-112.49_2011-12-04_09-13-48.png
External Libraries after adding Gemfile:
BTR - [CBTR] - ...Gemfile - JetBrains RubyMine (EAP) RM-112.49_2011-12-04_09-13-07.png
However, this does not fully answer my question about RubyMine and gems.  From the gems support documentation you provided above:

If there is no bundler, RubyMine scans all the project files for the 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.

(emphasis added).

This excerpt leaves me with two remaining questions:

  1. Does that article mean that RubyMine scans the project files for require calls, or gem calls?
  2. If the answer is require calls, do you have any insight as to why RubyMine has enough trouble with tracking require calls for JetBrains to resort to telling its users to create a Gemfile, even if no Gemfile is required by the project since the project does not use bundler?  Is this platform-dependent behavior?
0

RubyMine scans for gem calls. We have plans on understanding require calls though

0

Understood.  That fully answers all my questions, thank you Dennis.

0

Please sign in to leave a comment.