From 435b61b2ffb4b6167f9d856b1b03c59d26de68ea Mon Sep 17 00:00:00 2001 From: Wincent Colaiuta Date: Wed, 18 Mar 2009 11:21:47 +0100 Subject: [PATCH] Don't run plugin init files during "rake gems:build" Prior to this commit performing a "rake gems:unpack" on a gem which includes a C extension could break subsequent attempts to do "rake gems:build" or even to start up the application. The problem was that the initializer would try to evaluate any "init.rb" files in those vendored but not yet built gems, which would fail if the "init.rb" file or any other Ruby file in the gem tried to "require" the unbuilt C extension. Two workarounds exist: either manually building the extension and copying it into place; or explicitly avoiding running "rake gems:unpack" before "rake gems:build" (the latter only fails if "rake gems:unpack" has been run previously). Given that these workarounds might not always be possible or practical, this commit implements the minimum fix modification necessary to ensure that plugin "init.rb" files don't get evaluated during "rake gems:build". See: http://rails.lighthouseapp.com/projects/8994/tickets/2266 Signed-off-by: Wincent Colaiuta --- railties/lib/rails/plugin.rb | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb index 80deb73..5363a89 100644 --- a/railties/lib/rails/plugin.rb +++ b/railties/lib/rails/plugin.rb @@ -45,7 +45,7 @@ module Rails def load(initializer) return if loaded? report_nonexistant_or_empty_plugin! unless valid? - evaluate_init_rb(initializer) + evaluate_init_rb(initializer) unless $gems_build_rake_task @loaded = true end -- 1.6.2.1