Topic: Question about plugin load order and config.plugins

I have been successfully using the acts_as_taggable_on_steroids for a while.  I am now trying to use it in conjunction with the permalink_fu plugin.

Following the documentation, I added has_permalink :name to my tag.rb file.

The problem is that it appears by default Rails loads plugins in alphabetical order so acts_as_taggable... returns an error because it does not know what to do with the has_permalink call.

The only way I was able to get this to work was to add extend PermalinkFu to the top of my Tag class definition.  I also had to put a copy of permalink_fu.rb in the same directory as tag.rb.

There must be a better way, no?

I found something in the Rails Trac (bug #6851) that says I should be able to add an array of plugins to config.plugins in environment.rb and Rails will load the plugins in the order they are listed in the array.

I cannot get this to work.

When I try to start my server, I get this:

C:\Users\errol.SERENGETI\InstantRails\rails_apps\kb>ruby script/server
=> 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
C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/li
b/commands/servers/mongrel.rb:15: warning: already initialized constant OPTIONS
C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/gems/1.8/gems/rails-1.2.3/li
b/commands/servers/mongrel.rb:18: undefined method `options' for []:Array (NoMet
hodError)
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/site_ruby/1.8/r
ubygems/custom_require.rb:32:in `gem_original_require'
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/site_ruby/1.8/r
ubygems/custom_require.rb:32:in `require'
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/gems/1.8/gems/a
ctivesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/gems/1.8/gems/a
ctivesupport-1.4.2/lib/active_support/dependencies.rb:342:in `new_constants_in'
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/gems/1.8/gems/a
ctivesupport-1.4.2/lib/active_support/dependencies.rb:495:in `require'
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/gems/1.8/gems/r
ails-1.2.3/lib/commands/server.rb:39
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/site_ruby/1.8/r
ubygems/custom_require.rb:27:in `gem_original_require'
        from C:/Users/errol.SERENGETI/instantrails/ruby/lib/ruby/site_ruby/1.8/r
ubygems/custom_require.rb:27:in `require'
        from script/server:3

This happens even when I list all my plugins in alphabetical order -- the same order they are being loaded by default.