Certain core libraries not recognized by "Invalid require target inspection" ?

Gentlemen,

I just installed a fresh copy of RubyMine on OS X 10.5.7, it properly recognized my default 1.8.6 SDK and runs the following code just fine:

-----
require "strscan"
p StringScanner.new("test")
------

However, somehow the core lib "strscan" is not recognized by the inspection checking the validity of the require argument. It says "no such file to load" even though the code runs without any problems.

Do I have to configure something else to make RubyMine "see" the lib?

Cheers,
Frank

0
5 comments
Avatar
Permanently deleted user

Hello Frank,

I just installed a fresh copy of RubyMine on OS X 10.5.7, it properly recognized my default 1.8.6 SDK and runs the following code just fine:


-----
require "strscan"
p StringScanner.new("test")
------


However, somehow the core lib "strscan" is not recognized by the inspection checking the validity of the require argument. It says "no such file to load" even though the code runs without any problems.


Do I have to configure something else to make RubyMine "see" the lib?

I've tryed the same configuration on my Linux Box, and it seems that strscan is a binary .so file and cannot be processed by RubyMine due to lack of stub for this file.
Can you search for strascan in your Ruby installation folder?

Regards,
Oleg

0
Avatar
Permanently deleted user

Oleg,

there is no "strscan" file whatsoever in my ruby installation directories.
However, there is a stringscanner.rb stub file in my /Users/Frank/Library/Application Support/IntelliJIDEA80/ruby/rubystubs directory.
If I change the require statement to "require stringscanner" the inspection turns green (no problems) however, the program doesn't run anymore since the interpreter doesn't know of a "stringscanner" lib.

Could it be that the "stringscanner.rb" stub file should simply be called "strscan.rb" in order to match the actual ruby standard lib name?

Cheers,
Frank

0
Avatar
Permanently deleted user

Frank,

there is no "strscan" file whatsoever in my ruby installation directories.
However, there is a stringscanner.rb stub file in my /Users/Frank/Library/Application Support/IntelliJIDEA80/ruby/rubystubs directory.
If I change the require statement to "require stringscanner" the inspection turns green (no problems) however, the program doesn't run anymore since the interpreter doesn't know of a "stringscanner" lib.


Could it be that the "stringscanner.rb" stub file should simply be called "strscan.rb" in order to match the actual ruby standard lib name?

You are right, it seems like it is RubyMine stubs bug. Filled an issue: http://www.jetbrains.net/jira/browse/RUBY-4348

Thanks,
Oleg

0
Avatar
Permanently deleted user

Oleg,

ok, thanks.
Temporary solution is to simply rename "stringscanner.rb" to "strscan.rb" in your stubs directory and restart the IDE.
Works like charm.

Cheers,
Frank

0
Avatar
Permanently deleted user

Should be fixed in next version 1.1.1

Regards,
Oleg

0

Please sign in to leave a comment.