Hi List, I'm in the process of setting up RoR on an old solaris 8 box and have been building/installing ruby, etc by hand to get things going. This has led me to a problem with rubygems when gems are installed using an overly strict umask.
If a user doesn't have rights to read the gem specification file, the script 'requiring' the gem in question was bombing out with an unhandled exception in site_ruby/1.8/rubygems/source_index.rb (line 96). Looking at the code, it was due to spec_code being uninitialized (since the exception was generated during the call to File.read(file_name) above. The exception handler for this dumps the exception string concatenated with the value of spec_code in a call to alert_warning. This string concatenation is the culprit that generates another exception when spec_code is nil. This isn't a proper patch, but I hope you'll use it (as at least a reference) to correct the behaviour of the gem library in this case. # diff source_index.rb* 96c96 < alert_warning(e.inspect.to_s + "\n" + spec_code.to_s) --- > alert_warning(e.inspect.to_s + "\n" + spec_code) My testing with this 'patch' applied shows that it does allow the alert_warning method to proceed (whether it should or not is something I'm not familiar enough with the inner workings of gems to answer) causing things to die more normally later on during the require process. Hope this helps. Keep up the good work guys and girls! Thanks -Ben -- Ben Walton Systems Programmer - CHASS University of Toronto C:416.407.5610 | W:416.978.4302 GPG Key Id: 8E89F6D2; Key Server: pgp.mit.edu Contact me to arrange for a CAcert assurance meeting.
signature.asc
Description: PGP signature
_______________________________________________ Rubygems-developers mailing list [email protected] http://rubyforge.org/mailman/listinfo/rubygems-developers
