0

I am having trouble including the highcharts JS in my rails app when using the highcharts-rails gem.

I have added the gem to my gemfile

gem "highcharts"

And then ran bundle install

In my application.js file I have used (as described on the repo)

//= require highcharts

But I keep getting the error

Sprockets::FileNotFound for highcharts

Cjmarkham
  • 9,484
  • 5
  • 48
  • 81

2 Answers2

1

Please use highcharts-rails gem to allow using highcharts in a application. So:

Gemfile

gem 'highcharts-rails', '~> 3.0.0'

application.js

//= require highcharts

Then:

$ bundle install

Alternatively you can use highcharts-js-rails gem, or lazy_high_charts gem. The latter is most newly updated.

Малъ Скрылевъ
  • 16,187
  • 5
  • 56
  • 69
  • 1
    this is the right answer, the OP is including the wrong gem. – Anthony Nov 23 '14 at 19:39
  • Is there any way to physically find a javascript file that was added/installed from a gem? Where are these files stored? In my case I need to check if something is there and try to override it in order to come to a solution and make a pull request. – Tashows Nov 01 '18 at 10:21
  • @Tashows usually in bundled tree, either with grep/find or with aim of railties – Малъ Скрылевъ Nov 02 '18 at 09:05
-1

Create a highcharts.js blank file and see if the charts and all are working or not .. i had same issue with highlighter.js , i simply created a blank file highlighter.js and it worked .

Mayur Randive
  • 633
  • 1
  • 10
  • 20