Rubygems ignores -d option for generate_index #785

Closed
sheerun opened this Issue Jan 13, 2014 · 3 comments

Projects

None yet

2 participants

@sheerun
sheerun commented Jan 13, 2014

It doesn't matter what gems are in gems directory. It always compiles index for system gems. It also doesn't work from Ruby API. My quick monkeypatch:

class HackedIndexer < Gem::Indexer
  def build_indicies
    # ----
    # Gem::Specification.dirs = []
    # Gem::Specification.add_specs(*map_gems_to_specs(gem_file_list))
    # ++++
    Gem::Specification.all = map_gems_to_specs(gem_file_list) # This line
    # ----

    build_marshal_gemspecs
    build_modern_indicies if @build_modern

    compress_indicies
  end
end
@drbrain
Member
drbrain commented Jan 13, 2014

I can't reproduce this:

$ gem list hike

*** LOCAL GEMS ***

$ ls ~/tmp/repo/gems/hike*
/Users/drbrain/tmp/repo/gems/hike-1.2.3.gem
$ rm ~/tmp/repo/latest_specs.4.8.gz 
$ gem generate_index -d ~/tmp/repo/
Generating Marshal quick index gemspecs for 29 gems
.............................
Complete
Generated Marshal quick index gemspecs: 0.012s
Generating specs index
Generated specs index: 0.001s
Generating latest specs index
Generated latest specs index: 0.001s
Generating prerelease specs index
Generated prerelease specs index: 0.000s
Compressing indicies
Compressed indicies: 0.001s
$ ri --dump ~/tmp/repo/latest_specs.4.8 | grep hike
 ["hike", Gem::Version.new("1.2.3"), "ruby"],
@sheerun
sheerun commented Jan 13, 2014

For some reason it happens only on my production server. I'll try to give you some steps.

@drbrain
Member
drbrain commented May 28, 2014

Closing due to lack of feedback. Please reopen if you have steps to reproduce.

@drbrain drbrain closed this May 28, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment