airblade / chartjs-ror

[Not supported - see #53] Simplifies using Chart.js in Rails
MIT License
184 stars 57 forks source link

"couldn't find file 'chart' with type 'application/javascript'" in controller specs #24

Closed Bastes closed 9 years ago

Bastes commented 9 years ago

Hi,

I've just encountered this error message on a brand new rails 4.2.4 project while running controller specs that render views:

ActionView::Template::Error:
       couldn't find file 'Chart' with type 'application/javascript'

It happens at the line that requires Char in my application.js

It apparently works fine in development mode and when I remove the Chart and excanvas requires from my application.js, and breaks when one or the other is set.

I'm trying to figure out what's going wrong, and I'll be sure to send a PR if I solve it.

airblade commented 9 years ago

I've only ever tried chartjs-ror in a Rails 3.2 app so I'm looking forward to your finding out the solution!

Bastes commented 9 years ago

Me too ^^° apparently chart-js-rails has the same problem by the way.

Bastes commented 9 years ago

Another thing: I'm using the jquery gem along with zurb foundation, turbolinks, etc. ; all of these require their js with no fuss.

Bastes commented 9 years ago

False alarm, someone had the bright idea to put the gem in development mode only...

Bastes commented 9 years ago

By the way: it works like a charm on rails 4.2.4 ^^d (once you've got the gem in all modes ^^)

airblade commented 9 years ago

That's good to know, thanks!