rails ajax_pagination couldn't find file '

2019-05-15 11:56发布

问题:

I have installed ajax_pagination gem from https://github.com/ronalchn/ajax_pagination

When I restart my server i get this message

couldn't find file 'history' (in /Users/user/.rvm/gems/ruby-1.9.3-p362/gems/ajax_pagination-0.6.3/lib/assets/javascripts/ajax_pagination.js.erb:3)

and inserted calls in assets manifests, rails version is 3.2.8

I had tried installing a history gem ( https://github.com/philostler/historyjs-rails ) or adding history.js to assets but nothing helps

Thanks for any help!

回答1:

This appears to be a bug in the jquery-historyjs gem, which ajax_pagination depends on. You may want to report an issue on their github repo.

As a work-around, you could create a blank history.js file in app/assets/javascripts and try bringing in historyjs-rails.



回答2:

I had the same issue, all you need to do is:

  • Add gem 'jquery-historyjs' to your Gemfile,
  • Run bundle install
  • Then rails generate historyjs:install