Kaminari and Rails Admin

Post by on

Kaminari and rails admin

Today I banging my head to figure out why I got this error:

Showing
/Users/kureikain/Sites/notyim/trinity/app/views/incidents/index.html.erb
where line #8 raised:

undefined method `paginate' for
#<#<Class:0x007fec3a278200>:0x007fec3a2376b0>

I make sure I restart spring, make sure my initializer is right, gem is load. I even use gem open to puts some printf debuging there to ensure gem is load and paginate method is created.

No luck. Then I suddenly realize my kaminari gem loosk completelt different from Github. Check version and it’s 0.17.

I proceed to run bundle update but it’s still 0.17. I tried to lock it to 1.0.1 and get an error. At this point I realize it’s rails admin use >= 0.14 and that’s cause the issue. I points Rails admin to this commit and thing started to work.

Moral of story is make sure you have the right version of Gem by looking at Gemfile.locl before any further debug