Archive for August 27th, 2007|Daily archive page

What does “/…../mongrel.rb:15: warning: already initialized constant OPTIONS” means?

It turns out that our Rails installation has a problem cause I always got those error message when I tried to start server. Here is the complete logs if you’re curious:

bpdp@akakom:~/src/tbar$ script/server webrick
=> Booting WEBrick...
/opt/software/ruby/gems/rails-1.2.3/lib/commands/servers/webrick.rb:11: warning: already initialized constant OPTIONS
=> Booting Mongrel (use 'script/server webrick' to force WEBrick)
=> Rails application starting on http://0.0.0.0:3000
=> Call with -d to detach
=> Ctrl-C to shutdown server
** Starting Mongrel listening at 0.0.0.0:3000
** Starting Rails with development environment...
Exiting
/opt/software/ruby/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:15: warning: already initialized constant OPTIONS
/opt/software/ruby/gems/rails-1.2.3/lib/commands/servers/mongrel.rb:18: undefined method `options' for []:Array (NoMethodError)
        from /opt/software/ruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
        from /opt/software/ruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from /opt/software/ruby/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
        from /opt/software/ruby/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from /opt/software/ruby/gems/activesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
        from /opt/software/ruby/gems/rails-1.2.3/lib/commands/server.rb:39
        from /opt/software/ruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `gem_original_require'
        from /opt/software/ruby//lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:32:in `require'
        from script/server:3
bpdp@akakom:~/src/tbar$

So I started to find the solution online, but none helps. Some posts said that this error showed up because Rails can not find dependenc{y/ies} for some of its plugins. Hmm … ok, then it looks like I have to manually search for every plugins’ dependencies and then install them.

How to do that?

Easy. All I have to do is remove all of the plugins (I just move it to directory $RAILS_ROOT/tmp/plugins which I created myself) and then start move it one by one to $RAILS_ROOT/vendor/plugins and test it using $RAILS_ROOT/script/server webrick.

Then I found that activemerchant is my problem. I need builder gem.

It’s all easy but the error messages was really a mess :)