RubyMine code inspection gives incorrect "Missing 1 argument(s)"

I have an array 'foo' that's returned by a method call.

RM code inspection thinks that '' is a call into Kernel, not into Array, and gives an error: Missing 1 argument(s).

Is there a way to avoid this, other than suppressing that check?



I had a similar issue (which led me here), though with a different method.

In my case it was in spec files, where I'd do `create(:foo)`.  This resolves to FactoryBot.create, but it was flagged with the same error - wrong number of parameters - and when I control-B'd on it to go to the definition it took me into the 'templates' directory of Rails, to the template that would generate a Rails controller.  It's not even a Ruby file (filename extension was RB but syntax was not valid Ruby), it's a template used for generating controllers.

I discovered I could fix this by marking the offending template file - a file I will never care about - as "plain text".  (Project view, right-click filename, "Mark as Plain Text").  This caused it to disappear from the index.

RubyMine doesn't know where the real `create` method comes from, but at least it's not linking it to something completely bogus now.



I have the same issue when using RSpec + FactoryBot + ActiveAdmin.

Method `create` from factory bot shows 'Missing 1 argument' error because it thinks that this method comes from ActiveAdmin.

Is there a way to specify the library to specific method?



sorry for the delay. I didn't manage to reproduce the problem so could you please provide a code sample showing it.

sftp.dir.glob(directory, "*.#{file_extension}")
.select { |f| > 1.minutes.ago }
.map { |f|!("#{directory}/#{}") }

Please sign in to leave a comment.