Adding folders from the vendor director to Sprockets manifests

Disclaimer: I'm a total newbie to Ruby and RubyMine...

I wanted to use bower to manage third party dependencies. As such:

  1. I've configured bower to store assets in the /vendor/assets/components folder of my project
  2. Ive added the following to config/application.rb:
    config.assets.paths << Rails.root.join('vendor', 'assets', 'components')
  3. I've added the following to the application.js sprockets manifest:
    //= require angular/angular
    //= require angular-bootstrap/ui-bootstrap-tpls
  4. Restarted the rails server


All of this actually works fine. When I load my root/home page, script tags get rendered for both angular and angular-bootstrap... and my angularjs code is running fine.

However, RubyMine seems to think there is a problem in that application.js manifest... it has red lines under both of the requires that I added saying "cannot resolve director 'angular'" and "cannot resolve director 'angular-bootstrap'".

In the settings for my project I see I can configure javascript libraries, which I've done. I added a "Vendor Componnets" library with the /vendor/assets/components directory attached, as well as /vendor/assets/components/angular and /vendor/assets/components/angular-bootstrap.... but still RubyMine complains that it can't resolve the references in that application.js manifest (even through sprockets resolves them just fine).

Am I doing something wrong here or is this a "bug" in RubyMine?

Cheers,
James

2 comments
Comment actions Permalink

Hi,

this is a known bug (http://youtrack.jetbrains.com/issue/RUBY-15222)
Feel free to vote for it.

Oleg.

0
Comment actions Permalink

Done, thanks Oleg.

Kind Regards,
James Crosswell

0

Please sign in to leave a comment.