This project is archived and is in readonly mode.

#2721 ✓committed
Graeme Mathieson

Vendor gem failing rake gems:build

Reported by Graeme Mathieson | May 26th, 2009 @ 04:36 PM | in 2.x

I've got a problem with building vendored gems. If the gem is not also system-installed, it fails to build the gem. The error displayed is:

mathie@Tullibardine golflinks (master) $ rake gems:build --trace
(in /Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks)
** Invoke gems:build (first_time)
** Execute gems:build
rake aborted!
undefined method `full_name' for nil:NilClass
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:287:in `unpacked_gem_directory'
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:291:in `unpacked_specification_filename'
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/config/../vendor/rails/railties/lib/rails/gem_dependency.rb:174:in `build'
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb:11:in `__send__'
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/vendor/rails/activesupport/lib/active_support/core_ext/symbol.rb:11:in `to_proc'
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/vendor/rails/railties/lib/tasks/gems.rake:23:in `each'
/Users/mathie/Development/Rubaidh/ruby/rails_apps/golflinks/vendor/rails/railties/lib/tasks/gems.rake:23
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:597: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.7/lib/rake.rb:590:in `invoke_with_call_chain'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run'
/Library/Ruby/Gems/1.8/gems/rake-0.8.7/bin/rake:31
/usr/bin/rake:19:in `load'
/usr/bin/rake:19

The solution seems to be to make sure that the gem's specification can successfully be loaded by always adding the load path before attempting to build the gem. This seems somewhat convoluted, but is the only approach I tried that actually works. So, attached is a patch that makes it work.

Comments and changes to this ticket

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>

Attachments

Referenced by

Pages