This project is archived and is in readonly mode.
rake gems:refresh_specs not working as expected...
-
Adam S
Sorry should specify a little more info:
Rails 2.3.3, Ruby 1.8.6
Error trace:
rake gems:refresh_specs --trace (in /Users/adam/dev/temp/testing) ** Invoke gems:refresh_specs (first_time) ** Execute gems:refresh_specs rake aborted! undefined method `installed_source_index' for #<Gem::SourceIndex:0x331e04> /Users/adam/.gem/ruby/1.8/gems/rails-2.3.3/lib/rails/gem_dependency.rb:217:in `refresh' /Users/adam/.gem/ruby/1.8/gems/rails-2.3.3/lib/tasks/gems.rake:53 /Users/adam/.gem/ruby/1.8/gems/rails-2.3.3/lib/tasks/gems.rake:53:in `each' /Users/adam/.gem/ruby/1.8/gems/rails-2.3.3/lib/tasks/gems.rake:53 /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `call' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:636:in `execute' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `each' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:631:in `execute' /Users/adam/.gem/ruby/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' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:590:in `invoke_with_call_chain' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:583:in `invoke' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2051:in `invoke_task' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `each' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2029:in `top_level' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2023:in `top_level' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2001:in `run' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:2068:in `standard_exception_handling' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/lib/rake.rb:1998:in `run' /Users/adam/.gem/ruby/1.8/gems/rake-0.8.7/bin/rake:31 /usr/bin/rake:19:in `load' /usr/bin/rake:19 -
Matt Jones
- Assigned user set to Matt Jones
I noticed this a couple days back, but hadn't gotten around to ticketing it. The issue only occurs when running from Rails installed as a gem, so it's easy to miss when testing against edge in vendor/rails.
In the meantime, as in the classic doctor joke - "don't do that". refresh_specs was a hack to deal with the fact that the very first version of gem freezing wrote bogus specs in some cases. If there's a gem that doesn't unpack correctly using gems:unpack, that would be a much more interesting bug than this...
-
Adam S
Sure... I fixed this myself. I deleted the self-unpacked gem and
rake gems:unpacked it.But it had me slightly stumped and annoyed for a bit...
I wanted to unpack the gem so I could modify it, and didn't actually want any of the other gems unpacked.
I personally think the whole "specs" thing is a little nebulous... I can't find this mysterious 'specs list' which gets out of sync...
Why not just use the gemspec in the dir and compare against the desired version?
-Adam
-
Matt Jones
If you just want to unpack one gem, you can select it by passing the GEM= option to gems:unpack. The specifications are stored in each gem's directory, in a file called .specification - gemspecs would have been better, and making vendor/gems a real gem repo would have been even better. See #1128 Fix config.gem bugs and add more tests for some discussion on that issue...
-
Choon Keat Chew
Try
--- /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb 2009-10-13 23:36:08.000000000 +0800 +++ /opt/local/lib/ruby/gems/1.8/gems/rails-2.3.4/lib/rails/gem_dependency.rb.new 2009-10-13 23:35:58.000000000 +0800 @@ -214,8 +214,8 @@ def refresh Rails::VendorGemSourceIndex.silence_spec_warnings = true - real_gems = Gem.source_index.installed_source_index - exact_dep = Gem::Dependency.new(name, "= #{specification.version}") + real_gems = Rails::VendorGemSourceIndex.new(Gem.source_index).installed_source_index + exact_dep = Gem::Dependency.new(name, specification && "= #{specification.version}") matches = real_gems.search(exact_dep) installed_spec = matches.first if frozen? -
Ryan Bigg
- State changed from new to duplicate