# White-labeling - config.plugins-fu fails in Rails 2.1

**URL:** <https://www.ruby-forum.com/t/white-labeling-config-plugins-fu-fails-in-rails-2-1/140938>\
**Category:** Rails\
**Created:** [June 19, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/white-labeling-config-plugins-fu-fails-in-rails-2-1/140938 "2008-06-19T23:05:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [June 19, 2008, 11:05pm UTC](https://www.ruby-forum.com/t/white-labeling-config-plugins-fu-fails-in-rails-2-1/140938/1 "2008-06-19T23:05:12Z")

</div>

What I’m trying to do is to enumerate all available plugins and then  
exclude specific plugins. This allows me to white-label my site and  
load the necessary brand via plugin specified in the environment at  
run-time. If there’s a better way to accomplish this in Rails 2.1,  
I’m all ears.

The following approach in config/environment.rb for enumerating all  
the plugins to be loaded worked in Rails 2.0 but fails in Rails 2.1:

config.plugins = config.plugin\_locators.map do |locator|

locator.new(Rails::Initializer.new(config)).plugins  
end.flatten.map{|p| p.name.to\_sym}

Error is:

/usr/local/lib/ruby/gems/1.8/gems/rails-2.1.0/lib/rails/plugin/  
locator.rb:81:in `plugins’: wrong argument type Symbol (expected Proc)  
(TypeError)

Seems to be failing in the GemLocator#plugins method.

Any thoughts on how to modify this code to work in Rails 2.1? Or is  
there a better way to do what I am trying to accomplish?

Thanks.

Michael
