copiousfreetime / stickler

a tool to organize and maintain an internal gem distribution server
MIT License
143 stars 29 forks source link

stickler mirror does not work #4

Closed kenotron closed 12 years ago

kenotron commented 13 years ago

When I do a:

stickler mirror --server http://localhost:6789/ --gem-version 3.0.3 rails

I get this:

ERROR -> can't modify frozen string

This is a bug in the spec_lite.rb, line 20:

@version = Gem::Version.new( version )

This apparently causes my RubyGems 1.3.7 running on Ruby 1.9.2 to fail with a "can't modify frozen string" error. There are 2 ways I fixed it (both strange and hacky):

@version = version #Gem::Version.new( version )

OR run stickler like:

stickler mirror --server http://localhost:6789/ --gem-version=3.0.3 rails

And after these hacks, I further ran into this issue:

undefined method 'first' for "http://production.cf.rubygems.org/gems/rails-3.0.3.gem":String

Resourceful is buggy in that it tries to follow redirects and assumes that the response "Location" header is always an array. I suggest that Stickler would ditch the use of Resourceful gem (use CURL or Net::Http).

schlick commented 13 years ago

I've been trying to figure out how to fix this but no luck so far.

copiousfreetime commented 12 years ago

Looks like this is because the strings in ARGV are frozen, and Gem::Version.new does a strip! on its parameter. The version from --gem-version ends up being handed directly down to Gem::Version and as such is a frozen string and strip! modifies its receiver.

this is fixed in the next version

copiousfreetime commented 12 years ago

Version 2.1.3 pushed fixing this bug.