require a gem, get 'No such file to load" or completion

I downloaded some gems and require them in a project I'm doing (eg, require 'sqlite3') and even though it's not a failure when I try to  run the program, there is a warning line with "No Such File to Load" and I get no intellisense whatsoever on the project for the module or classes included.  I am using RubyMine 3.2.4 on windows 7

8 comments

I don't get any intellisense too. I use RVM on debian and it seems like Rubymine does not index gems.

0

IT seems to do it with select gems, like rails.

0

Hi,

Do you use bundler? If no please consider using it, it is a good way to handle gem dependencies in your application + RubyMine provides good support for it.

0

I do have bundler installed but it is not configured. Honestly, I don't even know what does it do. I will check it out. But my situation is, that I don't use Rails either. I do some backend stuff with Ruby, I use RVM and have installed a few gems. Thing is that RubyMine can't pick them up and index, even though it can recognise installed gems in gems setup settings. I don't get any code completion and considering that my setup is quite simple, I am quite surprised.

0

The issue isn't that I can't manage dependencies, it's that runtime doesn't display inspection  included gems.

0

So I have tried bundler and I can get a gem code completion, thanks. Is it a required 3rd package I need to use to get a code completion in Rubymine or is there another way to do it?

0

So I have tried bundler and I can get a gem code completion, thanks. Is it a required 3rd package I need to use to get a code completion in Rubymine or is there another way to do it?

There are 2 alternatives

1. Add Gemfile to your application, but don't use it on runtime (e.g. bundler may be not installed). RubyMine will fetch gem dependencies from Gemfile
2. If there is no Gemfile RubyMine scans for calls like

gem 'gem_name'

but Gemfile/bundler works more accurate. By the way bundler is designed not only for rails applications. In previous RubyMine versions it was allowed to manage gem dependencies (for code insight features) manually, but mostly people use bundler and they had specify gem dependencies twice - in Gemfile and RubyMine settings.

0

Please sign in to leave a comment.