Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve file in RubyMine

I am trying to use RubyMine (v6.3.3) for my rails project. After I added bootstrap-sass gem according its instruction in https://github.com/twbs/bootstrap-sass, RubyMine complains about the line I added in application.js file. However the file is actually in the scope of the projects' external libraries.

The project itself works as expected, just this RubyMine warning annoyed me.

Did I miss any step in configuration?

enter image description here

like image 847
Gordon Yuan Gao Avatar asked Jul 09 '14 05:07

Gordon Yuan Gao


2 Answers

It is confirmed to be a RubyMine issue.

bootstrap-sass gem has added assets to the assets path, and that's why the project works. https://github.com/twbs/bootstrap-sass/blob/master/lib/bootstrap-sass/engine.rb#L6

However RubyMine appeares to ignore the Rails.application.config.asset.paths setting and only inspect the default asset paths. That's why the red wavy underline appears.

Here is the open issue for RubyMine: http://youtrack.jetbrains.com/issue/RUBY-15585

The workaround to this is to create a symbol link (vendor/assets -> assets) in your local gem installation. It will shut RubyMine up.

2.1.0/gems/bootstrap-sass-3.2.0.0% ls -l vendor
total 8
lrwxr-xr-x  1 gogao  staff  9 Aug  7 11:28 assets -> ../assets

More details can be found in the GitHub issue https://github.com/twbs/bootstrap-sass/issues/684 (Thank you, @Ri4a)

like image 129
Gordon Yuan Gao Avatar answered Sep 25 '22 10:09

Gordon Yuan Gao


It's a problem with the bootstrap-sass gem. See here: https://github.com/twbs/bootstrap-sass/issues/684

like image 28
Ri4a Avatar answered Sep 25 '22 10:09

Ri4a