RubyMine require: "No such file to load" for a Gem

Hi RubyMine, JetBrains,

 

I'm a long time Python (with PyCharm) developer learning Ruby here so apologies if it's an easy question.

I'm using "RubyMine 2020.2.3 Build #RM-202.7660.39, built on October 8, 2020" evaluation at the moment. In a Debian 10 with "rvm" installed as suggested by RubyMine/IntelliJ documentation.

When I do "require 'mechanize'" (or other installed Gems) it works but RubyMine code editor says (when I press F2 or I go to the warning) "No such file to load" in the module.

(I've quickly tested with another package, 'wolfram', and it worked fine... is there anything special with 'mechanize'? Like https://youtrack.jetbrains.com/issue/RUBY-6626?)

Steps to reproduce:

  • File -> New Project
  • I create a new project (e.g. ruby-mine-test) and I leave selected "RVM: ruby-2.7.0". I don't create (but I've tried) "Use gemset"... . I click on "Create"
  • Tools -> Bundler -> Init
  • In the file "Gemfile" I write a new line: "gem 'mechanize'"
  • Tools -> Bundle -> Install. No arguments. It seems all good: "Bundle complete! 1 Gemfile dependency, 15 gems now installed"
  • Right click on the root of the new project -> New -> Ruby File/Class. I name it "ruby-mine-test.rb"
  • I type "require 'mechanize'" (autocompletion works when I type "mec..." and I can select 'mechanize'
  • I press "F2" and it goes to just before "'" in mechanize and it says "No such file to load"

Executing it works fine, the auto-completion if I typed "m = Mechanize." works (even without the require).

I've tried a few solutions from Google but no luck. Since it's a very simple example I'd like to know if I'm doing anything wrong or if I should double check anything in my system's installation.

Thank you very much for your information,

Carles

0
2 comments

Hello Carles,

could you please specify whether invoking Navigate | Declaration or Usages action on

require 'mechanize'

shows 'No such file to load' while the gem 'mechanize' is listed in the External libraries node and isn't highlighted as missing in Gemfile?

0

Hi Olga,

Sorry - I cannot test it: I was learning Ruby/Rails for a project but I'm back to Python/Django and not having RubyMine anymore.

Thanks for answering!

Carles

0

Please sign in to leave a comment.