This project is archived and is in readonly mode.
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
-

-

-

Matt Jones June 6th, 2009 @ 11:17 PM
The real issue here was the the environment wasn't loaded, and therefore gemspecs weren't being pulled from vendor/gems. The patch in #2773 incorporates a fix for this, by explicitly loading the .specification file from the directory passed to GemDependency.from_directory_name.
-

Graeme Mathieson June 9th, 2009 @ 05:31 AM
I'm happy for this ticket to be closed alongside #2773 being resolved.
-

Repository June 9th, 2009 @ 08:58 AM
- State changed from new to committed
(from [2c3d2906b255b1cb3aeb5d3abb9fe2dcb2872c28]) Fix several issues with the 2.3.2 gem loader.
Incorporates the following:
-
migrates back small change to gems:build:force from bfc1609a501fc3ed442685819de5bcdb5fbada1c to finish closing #2266.
-
unrolls to_proc calls in gems.rake, to match the change in master.
-
fixes #2722 by passing the options hash to dependencies during build. (includes a test)
-
fixes #2721 by loading the specification directly in from_directory_name. Adds an option to opt-out of specification loading when needed (in gems:refresh_specs, for instance). Includes tests.
-
fixes #2679 by refreshing specs for all frozen gems rather than just gems loaded from the environment.
-
fixes #2678 by passing the options hash to dependencies during unpack.
Signed-off-by: Michael Koziarski michael@koziarski.com
http://github.com/rails/rails/commit/2c3d2906b255b1cb3aeb5d3abb9fe2... -

Repository June 9th, 2009 @ 08:58 AM
(from [41a94048e55e082f373e19d9fcee311860aaba9e]) Fix several issues with the 2.3.2 gem loader.
Incorporates the following:
-
migrates back small change to gems:build:force from bfc1609a501fc3ed442685819de5bcdb5fbada1c to finish closing #2266.
-
unrolls to_proc calls in gems.rake, to match the change in master.
-
fixes #2722 by passing the options hash to dependencies during build. (includes a test)
-
fixes #2721 by loading the specification directly in from_directory_name. Adds an option to opt-out of specification loading when needed (in gems:refresh_specs, for instance). Includes tests.
-
fixes #2679 by refreshing specs for all frozen gems rather than just gems loaded from the environment.
-
fixes #2678 by passing the options hash to dependencies during unpack.
Signed-off-by: Michael Koziarski michael@koziarski.com
http://github.com/rails/rails/commit/41a94048e55e082f373e19d9fcee31... -
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
Attachments
Tags
Referenced by
-
2773
Rollup: Fix issues with 2.3.2 gem loader
fixes #2721 by loading the specification directly in
from...
-
2722
Force gem dependencies to rebuild if I run rake gems:build:force
fixes #2721 by loading the specification directly in
from...
-
2721
Vendor gem failing rake gems:build
fixes #2721 by loading the specification directly in
from...
-
2679
rake gems:refresh_specs should refresh all frozen gems
fixes #2721 by loading the specification directly in
from...
-
2678
Recursively unpack gem dependencies *and their dependencies*
fixes #2721 by loading the specification directly in
from...
-
2722
Force gem dependencies to rebuild if I run rake gems:build:force
fixes #2721 by loading the specification directly in
from...
-
2721
Vendor gem failing rake gems:build
fixes #2721 by loading the specification directly in
from...
-
2679
rake gems:refresh_specs should refresh all frozen gems
fixes #2721 by loading the specification directly in
from...
-
2678
Recursively unpack gem dependencies *and their dependencies*
fixes #2721 by loading the specification directly in
from...