Make pagination work on ruby 1.8
Fix spec failure on ruby 1.8
Add rubygems requires so things work on ruby 1.8