include the gem in your Gemfile:
gem 'chartkick'
And then execute:
$ bundle install
Steps:
1.rails g model student
2.rake db:migrate
3.rails g controller students index
<%= pie_chart Student.group(:course).count %>
<%= column_chart Student.group(:course).count %>