problems unpacking log4r

I was just starting to use log4r and everything was going peachy until I
tired to unpack it into my local vendor/gems. The next time I tried to
load my rails environment, I got:

config.gem: Unpacked gem log4r-1.1.2 in vendor/gems has no specification
file. Run 'rake gems:refresh_specs' to fix this

and:

no such file to load -- log4r

So - I dutifully tried running rake gems:refresh_specs, only to get:

rake aborted!
undefined method `installed_source_index' for
#<Gem::SourceIndex:0x2b4a6fc>

As a result, I was stuck. I could no longer load my environment.

After a lot of head scratching, a co-developer recommended renaming the
'src' folder in the log4r gems dir to 'lib'.

This magically works. I can now load my environment, although I still
get that pesky message about the specification file missing.

Any suggestion sas to how to clean this up would be very much
appreciated.

Yoram

I was just starting to use log4r and everything was going peachy until I
tired to unpack it into my local vendor/gems.

Let me guess - you used a bare "gem unpack" command to do this, right?
Not going to work...

After a lot of head scratching, a co-developer recommended renaming the
'src' folder in the log4r gems dir to 'lib'.

This magically works. I can now load my environment, although I still
get that pesky message about the specification file missing.

Any suggestion sas to how to clean this up would be very much
appreciated.

To start, rm -rf the mess in vendor/gems/log4r-1.1.2. A quick look at
log4r shows that it's not going to work without the .specification
file, as it uses a nonstandard location (src/) for it's source files.
Renaming src/ to lib/ worked (for suitably small values of "work")
because the default location that's assumed for doing a 'require' on a
gem is lib/<gem_name>.rb.

After tidying up, go ahead and run "rake gems:unpack", which should
*correctly* unpack the gem into vendor/gems.

Note that any "require" statements referring to log4r before it's
loaded (ie, in environment.rb or environments/*.rb) WILL FAIL in
strange ways, as the gem loader will be trying to grab log4r from the
system repository instead of vendor/gems.

Hope this helps!

--Matt Jones