This project is archived and is in readonly mode.

#2266 ✓committed
Wincent Colaiuta

rake gems broken for vendored gems which are unbuilt extensions

Reported by Wincent Colaiuta | March 17th, 2009 @ 10:50 AM | in 2.x

In between Rails 2.3.1 RC2 and 2.3.2 final, "rake gems" and "rake gems:build" became broken for gems which are vendored, are C extensions, and are not yet built.

I suspect the breakage was caused in the rewrite introduced in commit 99d75a7b02bf430a124b9c3e2515850959d78acf.

In order to reproduce the problem you need a gem which is a C extension, such as the "wikitext" gem:


sudo gem install wikitext

Now create a new Rails app:


rails gembug
cd gembug

Now add a "config.gem" line to "config/environment.rb":


config.gem 'wikitext'

Note that "rake gems" works fine for now, because you haven't yet vendored the gem:


(in /private/tmp/gembug)
 - [I] wikitext 

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

Now try unpacking the gem with "rake gems:unpack" (which works), but note that "rake gems" is now broken. "rake gems:build" is also broken. Here's the output of "rake gems --trace":


(in /private/tmp/gembug)
** Invoke gems (first_time)
** Invoke gems:base (first_time)
** Execute gems:base
** Invoke environment (first_time)
** Execute environment
no such file to load -- wikitext
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/gem_dependency.rb:179:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:305:in `each'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:305:in `load_gems'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:162:in `process'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
/private/tmp/gembug/config/environment.rb:9
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/misc.rake:4
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/gems.rake:17
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19
rake aborted!
no such file to load -- wikitext
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/private/tmp/gembug/vendor/gems/wikitext-1.5.1/lib/wikitext/nil_class.rb:15
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/private/tmp/gembug/vendor/gems/wikitext-1.5.1/rails/init.rb:15:in `evaluate_init_rb'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `evaluate_init_rb'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:142:in `evaluate_init_rb'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:48:in `load'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:in `load_plugins'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `each'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `load_plugins'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:348:in `load_plugins'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:163:in `process'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
/private/tmp/gembug/config/environment.rb:9
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
/Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
/Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/misc.rake:4
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
/Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/gems.rake:17
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.4/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

Evidently, "rake gems" (and also "rake gems:build") are trying to "require" files in the vendored gem which do not exist yet, because the C extension hasn't been built. In other words, "rake gems:build" will only work if the vendored gem is already built, which is a chicken-and-egg problem. Obviously, "script/server" is also broken; the app won't even start.

Looks like the logic introduced in commit 99d75a7b02bf430a124b9c3e2515850959d78acf will need to be changed so that at the very least "rake gems" and most certainly "rake gems:build" doesn't actually require the gems. I haven't yet fully grokked that code but I will continue to look into it and see if I can spot exactly where the bug lies.

In the meantime, the workaround is to copy the built extension from the system gem into the vendored gem:


$ cp /Library/Ruby/Gems/1.8/gems/wikitext-1.5.1/ext/wikitext.bundle vendor/gems/wikitext-1.5.1/ext/
$ rake gems
(in /private/tmp/gembug)
 - [F] wikitext 

I = Installed
F = Frozen
R = Framework (loaded before rails starts)

Comments and changes to this ticket

  • Wincent Colaiuta

    Wincent Colaiuta March 18th, 2009 @ 10:09 AM

    Ok, I've been analysing 99d75a7b02bf430a124b9c3e2515850959d78acf a bit more to see if I can figure out what's going on. I see it adds a "gems_build_rake_task" global variable which it uses to at least try to do the right thing when doing "rake gems:build", but it's not working.

    Here is the stack trace of "rake gems:build --trace":

    
    (in /private/tmp/gembug)
    ** Invoke gems:build (first_time)
    ** Execute gems:build
    ** Invoke gems:unpack (first_time)
    ** Invoke gems:install (first_time)
    ** Invoke gems:base (first_time)
    ** Execute gems:base
    ** Invoke environment (first_time)
    ** Execute environment
    rake aborted!
    no such file to load -- wikitext
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:36:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    /private/tmp/gembug/vendor/gems/wikitext-1.5.1/lib/wikitext/nil_class.rb:15
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    /private/tmp/gembug/vendor/gems/wikitext-1.5.1/rails/init.rb:15:in `evaluate_init_rb'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:146:in `evaluate_init_rb'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:142:in `evaluate_init_rb'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin.rb:48:in `load'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:38:in `load_plugins'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `each'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/rails/plugin/loader.rb:37:in `load_plugins'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:348:in `load_plugins'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:163:in `process'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `send'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/initializer.rb:113:in `run'
    /private/tmp/gembug/config/environment.rb:9
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /Library/Ruby/Site/1.8/rubygems/custom_require.rb:31:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /Library/Ruby/Gems/1.8/gems/activesupport-2.3.2/lib/active_support/dependencies.rb:156:in `require'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/misc.rake:4
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/gems.rake:17
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:588:in `invoke_prerequisites'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:585:in `invoke_prerequisites'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:577:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
    /Library/Ruby/Gems/1.8/gems/rails-2.3.2/lib/tasks/gems.rake:23
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `call'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:617:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:612:in `execute'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:578:in `invoke_with_call_chain'
    /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/monitor.rb:242:in `synchronize'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:571:in `invoke_with_call_chain'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:564:in `invoke'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2027:in `invoke_task'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `each'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2005:in `top_level'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1999:in `top_level'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1977:in `run'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:2044:in `standard_exception_handling'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/lib/rake.rb:1974:in `run'
    /Library/Ruby/Gems/1.8/gems/rake-0.8.4/bin/rake:31
    /usr/bin/rake:19:in `load'
    /usr/bin/rake:19
    

    This stack trace shows that the problem is that "evaluate_init_rb" is firing off the "init.rb" file in the vendored but not yet built gem, which is causing the NameError to be triggered.

    I also tried blowing away the gem entirely and doing "rake gems:build" instead of "rake gems:unpack" followed by "rake gems:build". In this case the gems does get unpacked and built before the init.rb is called (if it is even called, I didn't check).

    I am going to look into patching the "evaluate_init_rb" method or some other appropriate point in the call chain to look at the "gems_build_rake_task" global and prevent the unwanted "init.rb" from firing.

  • Wincent Colaiuta

    Wincent Colaiuta March 18th, 2009 @ 10:28 AM

    • Tag set to patch

    Ok. Attaching a minimal patch to get "rake gems:build" working again.

  • Wincent Colaiuta

    Wincent Colaiuta March 23rd, 2009 @ 04:58 PM

    5 days have passed. Anyone had a chance to look at this patch?

  • Pratik

    Pratik March 23rd, 2009 @ 05:42 PM

    • Assigned user set to “Matt Jones”
  • Matt Jones

    Matt Jones March 24th, 2009 @ 01:12 AM

    • Tag changed from patch to gems, patch

    There's a bit of a catch-22 here - the changes to the build command in that commit mean that gems not requested by config.gem won't get built. BUT, plugins are supposed to require any gems they depend on with config.gem statements in init.rb.

    This patch as written would break in a situation where plugin X (installed in vendor/plugins) depended on wikitext. The unpack task would correctly pick up the dependency, and then build wouldn't be run (as the plugin's init.rb). At that point, the app is wedged - trying to load the environment will get the error seen above.

  • Wincent Colaiuta

    Wincent Colaiuta March 24th, 2009 @ 06:10 AM

    So what's the solution then? This behaviour here is a regression. It used to work prior to 99d75a7b02bf430a124b9c3e2515850959d78acf, and now it doesn't. How do we fix it?

  • David Dollar

    David Dollar March 27th, 2009 @ 06:58 PM

    A patch is attached that should handle these cases. I've added some code that does a check for gems with native components that have not yet been built and bails out with an error.

    This error is similar in nature to the check for unloaded dependencies.

    This should at least let you know what is going wrong and give you a means to fix it rather than bailing out with cryptic errors.

  • David Dollar

    David Dollar March 27th, 2009 @ 07:01 PM

    Apparently my rebase-fu is broken again, new patch attached.

  • Matt Jones

    Matt Jones March 27th, 2009 @ 08:31 PM

    The patch still doesn't address the problem - Rails is loading all of the rails/init.rb files it can find (as part of plugin initialization). The init.rb file for wikitext requires the native extension, which fails.

    I'm not totally convinced that this even is patchable in the current system - we need to load init.rb files to pick up dependencies specified there, but we can't ensure that one of those files won't try to require an unbuild native extension.

  • David Dollar

    David Dollar March 27th, 2009 @ 08:37 PM

    This patch causes the initializer to abort() out before plugin initialization if there are any unbuilt gems. How is the case not handled?

  • Matt Jones

    Matt Jones March 27th, 2009 @ 08:41 PM

    In this ticket's case, the problem is that calling 'rake gems:build' loads the environment (via gems:unpack), which tries to load the plugins, which blows up. So the solution recommended by the error message doesn't work.

  • David Dollar

    David Dollar March 27th, 2009 @ 08:52 PM

    How would that case ever be encountered?

    In what cases is there an unpacked, unbuilt gem in vendor/gems that is not specified by config.gem?

    If the file is specified by config.gem anywhere, the initializer will abort out as it will recognize it as unbuilt.

  • David Dollar

    David Dollar March 27th, 2009 @ 08:59 PM

    Add config.gem 'wikitext' to environment.rb

    [~Code/WikiTextTest] rake gems (in /Users/ddollarCode/WikiTextTest) - [F] aws-s3 = 0.5.1

    - [I] xml-simple
    - [R] builder 
    - [I] mime-types 
    
    
    • [F] RedCloth
    • [I] wikitext

    I = Installed F = Frozen R = Framework (loaded before rails starts)

    [~Code/WikiTextTest] rake gems:unpack (in /Users/ddollarCode/WikiTextTest) WARNING: Installing to ~/.gem since /Library/Ruby/Gems/1.8 and

          /usr/bin aren't both writable.
    
    

    Unpacked gem: '/Users/ddollarCode/WikiTextTest/vendor/gems/wikitext-1.5.2'

    [~Code/WikiTextTest] rake gems (in /Users/ddollarCode/WikiTextTest) The following gems have native components that need to be built wikitext

    You're running: ruby 1.8.6.114 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby rubygems 1.3.1 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8, /Library/Ruby/Gems/1.8

    Run rake gems:build to build the unbuilt gems.

    [~Code/WikiTextTest] rake gems:build (in /Users/ddollarCode/WikiTextTest) Built gem: '/Users/ddollarCode/WikiTextTest/vendor/gems/wikitext-1.5.2'

    [~/Code/WikiTextTest] rake gems (in /Users/ddollar/Code/RailsApp) - [F] aws-s3 = 0.5.1

    - [I] xml-simple
    - [R] builder 
    - [I] mime-types 
    
    
    • [F] RedCloth
    • [F] wikitext

    I = Installed F = Frozen R = Framework (loaded before rails starts)

  • David Dollar

    David Dollar March 27th, 2009 @ 09:00 PM

    Trying that again, curse you Lighthouse-lack-of-preview!

    Add config.gem 'wikitext' to environment.rb

    
    [~Code/WikiTextTest] rake gems
    (in /Users/ddollarCode/WikiTextTest)
     - [F] aws-s3 = 0.5.1
        - [I] xml-simple 
        - [R] builder 
        - [I] mime-types 
     - [F] RedCloth 
     - [I] wikitext 
    
    I = Installed
    F = Frozen
    R = Framework (loaded before rails starts)
    
    
    [~Code/WikiTextTest] rake gems:unpack
    (in /Users/ddollarCode/WikiTextTest)
    WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
              /usr/bin aren't both writable.
    Unpacked gem: '/Users/ddollarCode/WikiTextTest/vendor/gems/wikitext-1.5.2'
    
    
    [~Code/WikiTextTest] rake gems
    (in /Users/ddollarCode/WikiTextTest)
    The following gems have native components that need to be built
      wikitext  
    
    You're running:
      ruby 1.8.6.114 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
      rubygems 1.3.1 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8, /Library/Ruby/Gems/1.8
    
    Run `rake gems:build` to build the unbuilt gems.
    
    
    [~Code/WikiTextTest] rake gems:build
    (in /Users/ddollarCode/WikiTextTest)
    Built gem: '/Users/ddollarCode/WikiTextTest/vendor/gems/wikitext-1.5.2'
    
    
    [~/Code/WikiTextTest] rake gems
    (in /Users/ddollar/Code/RailsApp)
     - [F] aws-s3 = 0.5.1
        - [I] xml-simple 
        - [R] builder 
        - [I] mime-types 
     - [F] RedCloth 
     - [F] wikitext 
    
    I = Installed
    F = Frozen
    R = Framework (loaded before rails starts)
    
  • David Dollar

    David Dollar March 27th, 2009 @ 09:01 PM

    Fixing the patch to not check gems that are not frozen for built status

  • Matt Jones

    Matt Jones March 27th, 2009 @ 10:03 PM

    After applying the very latest patch, I'm not getting the same results here - I get the same output, up until I run gems:build. That errors out with the same 'no such file to load' error as before.

  • David Dollar

    David Dollar March 27th, 2009 @ 10:05 PM

    Matt:

    Could you post the output with --trace of your failure?

  • Matt Jones

    Matt Jones March 27th, 2009 @ 10:07 PM

    Sure - here's the full trace:

    
    (in /Users/mattjones/grip/gembug)
    ** Invoke gems:build (first_time)
    ** Execute gems:build
    ** Invoke gems:unpack (first_time)
    ** Invoke gems:install (first_time)
    ** Invoke gems:base (first_time)
    ** Execute gems:base
    ** Invoke environment (first_time)
    ** Execute environment
    rake aborted!
    no such file to load -- wikitext
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    /Users/mattjones/grip/gembug/vendor/gems/wikitext-1.5.1/lib/wikitext/nil_class.rb:15
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    /Users/mattjones/grip/gembug/vendor/gems/wikitext-1.5.1/rails/init.rb:15:in `evaluate_init_rb'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/rails/plugin.rb:146:in `evaluate_init_rb'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/core_ext/kernel/reporting.rb:11:in `silence_warnings'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/rails/plugin.rb:142:in `evaluate_init_rb'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/rails/plugin.rb:48:in `load'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:38:in `load_plugins'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `each'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/rails/plugin/loader.rb:37:in `load_plugins'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/initializer.rb:369:in `load_plugins'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/initializer.rb:165:in `process'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/initializer.rb:113:in `send'
    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/initializer.rb:113:in `run'
    /Users/mattjones/grip/gembug/config/environment.rb:9
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    /usr/local/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:521:in `new_constants_in'
    /Users/mattjones/grip/gembug/vendor/rails/activesupport/lib/active_support/dependencies.rb:156:in `require'
    /Users/mattjones/grip/gembug/vendor/rails/railties/lib/tasks/misc.rake:4
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
    /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
    /Users/mattjones/grip/gembug/vendor/rails/railties/lib/tasks/gems.rake:17
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
    /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
    /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:588:in `invoke_prerequisites'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:585:in `invoke_prerequisites'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:577:in `invoke_with_call_chain'
    /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
    /Users/mattjones/grip/gembug/vendor/rails/railties/lib/tasks/gems.rake:23
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `call'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:617:in `execute'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:612:in `execute'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:578:in `invoke_with_call_chain'
    /usr/local/lib/ruby/1.8/monitor.rb:238:in `synchronize'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:571:in `invoke_with_call_chain'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:564:in `invoke'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2019:in `invoke_task'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `each'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1997:in `top_level'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1991:in `top_level'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1970:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:2036:in `standard_exception_handling'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/lib/rake.rb:1967:in `run'
    /usr/local/lib/ruby/gems/1.8/gems/rake-0.8.3/bin/rake:31
    /usr/local/bin/rake:19:in `load'
    /usr/local/bin/rake:19
    
  • David Dollar

    David Dollar March 27th, 2009 @ 10:17 PM

    /Users/mattjones/grip/gembug/config/../vendor/rails/railties/lib/initializer.rb:369:in load_plugins'

    The initializer should never get there with unbuilt gems. Try removing vendor/gems/wikitext and starting over, perhaps it was in an odd state from pre-patch.

  • David Dollar

    David Dollar April 1st, 2009 @ 08:07 PM

    Could I get someone to take a look at this (the original submitter or Matt Jones)

    The patch should be quite a help to those using gems with native extensions.

  • Wincent Colaiuta

    Wincent Colaiuta April 1st, 2009 @ 09:34 PM

    Just a note for anyone trying out any of these patches using the wikitext gem to reproduce the problem.

    I actually patched the gem to work around the issue:

    http://git.wincent.com/wikitext..../init.rb;h=fba7edddbd028fe54762a003d1995a489498a464;hp=d201b626b430e69b1f69f81e88da679babd60317;hb=b1b1b38e93db1c7b009480c897da255265c882c4;hpb=2acdc7fb90cf17d88ec7b8230923782904ff70ec

    So if you want to trigger the bug your config.gem line should explicitly require version 1.5.1, because version 1.5.2 contains the workaround:

    
    config.gem 'wikitext', :version => '1.5.1'
    

    And to install version 1.5.1 of the gem if you don't have it already, you'd have to pass a specific version in:

    
    gem install wikitext --version 1.5.1
    

    I still think the regression should be fixed in Rails though, because it's better than patching any and all third-party extensions which might be affected by the issue.

  • Wincent Colaiuta

    Wincent Colaiuta April 1st, 2009 @ 09:35 PM

    Lighthouse ate my link. Here's the patch:

    
    diff --git a/rails/init.rb b/rails/init.rb
    index d201b62..fba7edd 100644
    --- a/rails/init.rb
    +++ b/rails/init.rb
    @@ -1,4 +1,4 @@
    -# Copyright 2008 Wincent Colaiuta
    +# Copyright 2008-2009 Wincent Colaiuta
     # This program is free software: you can redistribute it and/or modify
     # it under the terms of the GNU General Public License as published by
     # the Free Software Foundation, either version 3 of the License, or
    @@ -12,6 +12,10 @@
     # You should have received a copy of the GNU General Public License
     # along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    -require 'wikitext/nil_class'
    -require 'wikitext/string'
    -require 'wikitext/rails'
    +# Avoid Rails bug #2266 by not requiring during "rake gems:build"
    +# See: https://rails.lighthouseapp.com/projects/8994/tickets/2266
    +unless $gems_build_rake_task
    +  require 'wikitext/nil_class'
    +  require 'wikitext/string'
    +  require 'wikitext/rails'
    +end
    
  • David Dollar

    David Dollar April 1st, 2009 @ 10:06 PM

    I've modified the patch to have gems:build get the list of gems from vendor/gems rather than by loading the environment. Wikitest 1.5.1 works now, evidenced below.

    
    [~/Code/WikiTest] rake gems
    (in /Users/ddollar/Code/WikiTest)
     - [F] aws-s3 = 0.5.1
        - [F] xml-simple 
        - [R] builder 
        - [F] mime-types 
     - [F] RedCloth 
     - [ ] wikitext = 1.5.1
    
    I = Installed
    F = Frozen
    R = Framework (loaded before rails starts)
    
    
    [~/Code/WikiTest] sudo rake gems:install
    (in /Users/ddollar/Code/WikiTest)
    gem install wikitext --version "= 1.5.1"
    Building native extensions.  This could take a while...
    Successfully installed wikitext-1.5.1
    1 gem installed
    
    
    [~/Code/WikiTest] rake gems
    (in /Users/ddollar/Code/WikiTest)
     - [F] aws-s3 = 0.5.1
        - [F] xml-simple 
        - [R] builder 
        - [F] mime-types 
     - [F] RedCloth 
     - [I] wikitext = 1.5.1
    
    I = Installed
    F = Frozen
    R = Framework (loaded before rails starts)
    
    
    [~/Code/WikiTest] rake gems:unpack:dependencies
    (in /Users/ddollar/Code/WikiTest)
    WARNING:  Installing to ~/.gem since /Library/Ruby/Gems/1.8 and
              /usr/bin aren't both writable.
    Unpacked gem: '/Users/ddollar/Code/WikiTest/vendor/gems/wikitext-1.5.1'
    
    
    [~/Code/WikiTest] rake gems
    (in /Users/ddollar/Code/WikiTest)
    The following gems have native components that need to be built
      wikitext  = 1.5.1
    
    You're running:
      ruby 1.8.6.114 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
      rubygems 1.3.1 at /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8, /Library/Ruby/Gems/1.8
    
    Run `rake gems:build` to build the unbuilt gems.
    
    
    [~/Code/WikiTest] rake gems:build
    (in /Users/ddollar/Code/WikiTest)
    Built gem: '/Users/ddollar/Code/WikiTest/vendor/gems/wikitext-1.5.1'
    
    
    [~/Code/WikiTest] rake gems
    (in /Users/ddollar/Code/WikiTest)
     - [F] aws-s3 = 0.5.1
        - [F] xml-simple 
        - [R] builder 
        - [F] mime-types 
     - [F] RedCloth 
     - [F] wikitext = 1.5.1
    
    I = Installed
    F = Frozen
    R = Framework (loaded before rails starts)
    
  • Wincent Colaiuta

    Wincent Colaiuta April 1st, 2009 @ 10:43 PM

    "modified the patch to have gems:build get the list of gems from vendor/gems rather than by loading the environment"

    Will certainly fix the breakage, and the patch looks good to me. I guess it also addresses Matt Jone's concern about stuff in "vendor/plugins" which could contain "config.gem" setup in init.rb files (ie. "rake gems:unpack" would still run those init.rb files and the gems would get unpacked, and then "rake gems:build" would correctly build them).

  • David Dollar

    David Dollar April 29th, 2009 @ 06:26 AM

    New patch attached, includes tests. Applies cleanly against 2-3-stable and master.

  • Repository

    Repository April 29th, 2009 @ 07:19 AM

    • State changed from “new” to “committed”

    (from [6e3bede928d95cbf5fe70ab2283adce28da3401d]) Attempt to deal with more cases of gems with native components.

    This commit adds a rudimentary check for 'unbuilt' gems, so that we can abort the application load if there are any gems that have native components that have not yet been built.

    The rake task gems:build has now only builds 'unbuilt' gems as a result.

    The rake task gems:build:force has been added to deal with cases of incomplete builds, or any case where you need to force the build of all of your gems.

    Changes the gems:build task to get its gem list by parsing directory entries in vendor/gems, which sidesteps the chicken/egg issues involved with having a gem unpacked into vendor/gems without before its native bits are compiled.

    [#2266 state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

  • Repository

    Repository April 29th, 2009 @ 07:20 AM

    (from [599f2cfb4a0e0ec4135265bf5c56b83f1450beea]) Attempt to deal with more cases of gems with native components.

    This commit adds a rudimentary check for 'unbuilt' gems, so that we can abort the application load if there are any gems that have native components that have not yet been built.

    The rake task gems:build has now only builds 'unbuilt' gems as a result.

    The rake task gems:build:force has been added to deal with cases of incomplete builds, or any case where you need to force the build of all of your gems.

    Changes the gems:build task to get its gem list by parsing directory entries in vendor/gems, which sidesteps the chicken/egg issues involved with having a gem unpacked into vendor/gems without before its native bits are compiled.

    [#2266 state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

  • Tim Connor

    Tim Connor May 6th, 2009 @ 07:02 PM

    Actually, this is just a subset. rake is still way to easy to break with gem dependencies: https://rails.lighthouseapp.com/...

    I've got a commit I am about to push (using the more general $rake_gem_task check in load_gems) that partially fixes the use cases I am seeing, but maybe could be looked over for these problems.

  • Matt Jones

    Matt Jones May 7th, 2009 @ 01:39 AM

    • State changed from “committed” to “open”

    There's a tiny patch attached to clean up the code added here - the gems:build:force task was still calling gems:unpack. That will trigger the original bug of the ticket..

  • Repository

    Repository May 7th, 2009 @ 02:58 AM

    • State changed from “open” to “committed”

    (from [bfc1609a501fc3ed442685819de5bcdb5fbada1c]) Remove stray call to gems:unpack in gems:build:force

    [#2266 state:committed]

    Signed-off-by: Jeremy Kemper jeremy@bitsweat.net http://github.com/rails/rails/co...

  • Jeff Kreeftmeijer

    Jeff Kreeftmeijer November 8th, 2010 @ 08:24 AM

    • Tag cleared.

    Automatic cleanup of spam.

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

<h2 style="font-size: 14px">Tickets have moved to Github</h2>

The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>

People watching this ticket

Referenced by

Pages