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:
############
require File.join(File.dirname(FILE), ‘boot’)
Rails::Initializer.run do |config|
config.action_controller.session = {
:session_key => ‘_history_session’,
:secret =>
‘13093336cef6ac2aeeca0681504f5b7d24d398d333fd5c1563772a7cc9b648ba9222109406d91c49e5cfeb03266feab44634326c5a4d8fcb7658360f7b4b0f80’
}
config.gem ‘searchlogic’
config.gem ‘will_paginate’
end
########