Using Chartkick in Rails 4.0

To get chartkick working in Rails 4, I did the following:

1. Added chartkick gem to my Gemfile (bundle install)

gem 'chartkick'

2. Downloaded Google jsapi file into my vendor directory

/railsapp/vendor/assets/javascripts/jsapi.js

3. Added chartkick and jsapi to my application.js

//= require jsapi
//= require chartkick

After that, charts showed up on a consistent basis.


Be sure to include the JavaScript files before the charts.

<%= javascript_include_tag "//www.google.com/jsapi", "chartkick" %>