Namespace sufolders not found

已完成

 Hi, i have a couple of subfolders for the models in my rails project for which RubyMine fails to find any target.

class Foo::Bar < ActiveRecord::Base

and the folder structure

foo

--> bar

Everthing works fine but RubyMine says "Cannot find 'Foo' "

Is there a way to fix that?

0

Hi, Sebastian,

I didn't manage to reproduce the problem. What version are you using? If it's on the last one, then could you please try doing File | Invalidate Caches and restarting IDE.

0
Avatar
Sebastian Goldenberg

Hi,

i am using rails 4.2.7.1 and ruby 2.3.0

Restarting and cache reloading does not help.

However if the code looks like:

module Foo

class Bar < ActiveRecord::Base

...

end

The RMine stops complaining and rails does not care either. My guess is that RubyMine tries to look up a Module if it encounters this Foo::Bar syntax and complains if there is no explicit Module Foo.

Both seem to be valid in rails :)

0
Avatar
Permanently deleted user

We have the same Problem here in our project.

So I just deactivated the inspection:
Settings > Editor > Inspections > Unresolved Ruby Reference

A real pity.

0

@Sebastian @Merkdir

sorry for such a delay. The fix most likely will be included to RubyMine 2016.3.1.

0

I have a similar problem. Follows attached image of RubyMine 2016.3 not recognizing the namespace.

0

@Fernando, 

could you please check how it goes in RubyMine 2016.3.1?

0

Seems it's working on 2016.3.1 :) Thank you.

0

Great to hear that :)

0

请先登录再写评论。