9

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

Gordon Yuan Gao
  • 694
  • 6
  • 20

5 Answers5

11

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)

Gordon Yuan Gao
  • 694
  • 6
  • 20
3

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

Ri4a
  • 640
  • 7
  • 13
1

Use //= require bootstrap-sprockets instead of //= require bootstrap_sprockets in application.js

Allerin
  • 1,108
  • 10
  • 7
1

Same problem here, it seems that rubymine does not recognises the libraries stored in vendor/assets/components. If you store your library in vendor/assets/javascripts or in app/assets/javascripts, it will be recognized by rubymine.

SylvainB
  • 394
  • 7
  • 16
0

I try many methods, but they don't work for me.

At last, I fixed it using a strange method:

  1. Quit RubyMine
  2. cd /path/your_rails_project
  3. rm -r .idea/
  4. Restart RubyMine and open your project

The related environment in my case:

RubyMine: 7.1

bootstrap-sass: 3.3.4

I hope this answer would save other guys' time.

Damon Chen
  • 151
  • 1
  • 1
  • 6