I was getting the error while installing an older rails application. After googling I've got the solution from a discussion thread to add following block in right before the initialization in to config/environment.rb and worked for me.
if Gem::VERSION >= "1.3.6"
r = super
(r == Gem::Requirement.default) ? nil : r