require 'thread' finds files twice


I'm a newbie both on Ruby and RubyMine. I'm trying out RubyMine on my current project and I'm encountering issues during Inspection that I cannot solve:

Whenever I use require 'thread' (and a couple of other standard libraries), I always get the reply:

'More than one file is available for given name'

I also see in the External Lbiraries that there are indeed two thread.rb files:
- one in the ruby lib dir, taht loads the so
- one in the rubymine rubystubs dir

I guess the problem is that rubymine sees both files ... how to solve this?

- I'm running on Fedora 13, using ruby 1.8.6 and last rubymine (2.0.2)
- I have tried with IntelliJ and the same problem arises there too.


Comment actions Permalink

Hello Kris,

Thanks for reporting this, this is a bug, RubyMine shouldn't warn you in this case, because only of them will be loaded according to the loadpath order.
I've created an issue for this problem:
Feel free to vote, comment and track progress of it.


Comment actions Permalink

Thanks for the reply. If the error is just a warning and one of the files will be loaded anyway, I'm afraid there is another problem at hand

I initially considered the errors/warnings that object types like SizedQueue which depend on the thread require indicated that the thread file was not parsed by RubyMine. Reading your reply, I now believe however that it loads the file from the ruby lib dir instead of the rubystubs and therefore fails to recognise the classes defined in the thread library and thus also is not able to autocomplete either.

I would expect the rubystubs to load by preference over the ruby lib files as, I guess that that's what the stubs are there for. Is there a way to influence this behaviour? In the External Libraries/< Ruby SDK 1.8.6 > the sub directories are listed in alfabetic order an I cannot change the order by hand.



Please sign in to leave a comment.