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
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:inrequirement’
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:ingem’
add_load_paths' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:inadd_gem_load_paths’
each' from C:/Ruby/lib/ruby/gems/1.8/gems/rails-2.3.5/lib/initializer.rb:301:inadd_gem_load_paths’
process' ... 10 levels... from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:inrequire’
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:

require File.join(File.dirname(FILE), ‘boot’) do |config|

config.action_controller.session = {
:session_key => ‘_history_session’,
:secret =>

config.gem ‘searchlogic’
config.gem ‘will_paginate’


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs