config.gem causes stack level too deep?

I'm trying to figure out why config.gem seems to cause problems.

I have installed two gems 'will_paginate' and 'searchlogic' that need to be declared in the environment.rb file in order to be useful. I installed 'will_paginate' first. After putting the config.gem 'will_paginate' command in my environment.rb, i rebooted mongrel only to get:

=> Booting Mongrel => Rails 2.3.5 application starting on http://0.0.0.0:3000 C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement': stack level too deep (SystemStackError)   from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:119:in `requirement'   from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:210:in `activate'   from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems.rb:1056:in `gem'   from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/rails/gem_dependency.rb:73:in `add_load_paths'   from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'   from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `each'   from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:in `add_gem_load_paths'   from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:132:in `process'    ... 10 levels...   from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'   from ./script/server:3   from -e:2:in `load'   from -e:2

I removed the config line and it went away. Of course, this wasn't good enough since I wanted the will_paginate functionality. Finally i discovered if I replaced the config.gem command with a require 'will_paginate' line at the end of the file I could avoid the error spam and still get my functionality.

Here is the text of my environment.rb file without comments: