rubygems install error

A

Ara.T.Howard

i get this running install.rb

ERROR: Failed to migrate the old gems located in...
/dmsp/reference/ruby-1.8.1/lib/ruby/gems/1.8
...to the /dmsp/reference/ruby-1.8.1/lib/ruby/gems/1.8/gems directory
You should move them manually, or your gems DB will be an invalid state
Backtrace follows:
Is a directory - /dmsp/reference/ruby-1.8.1/lib/ruby/gems/1.8/gems/cache
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:409:in `initialize'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:409:in `open'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:409:in `copy_file'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:408:in `open'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:408:in `copy_file'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:459:in `mv'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:446:in `fu_each_src_dest'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:722:in `fu_each_src_dest0'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:722:in `fu_each_src_dest'
/dmsp/reference/ruby-1.8.1/lib/ruby/1.8/fileutils.rb:446:in `mv'
install.rb:56:in `install_rb'
install.rb:54:in `glob'
install.rb:54:in `install_rb'
install.rb:100
Successfully built RubyGem
Name: sources
Version: 0.0.1
File: sources-0.0.1.gem
Successfully installed sources version 0.0.1


i only had a few seconds to look at it - but here's possible patch:

--- install.rb.org 2004-06-30 18:55:59.000000000 -0600
+++ install.rb 2004-06-30 18:55:35.000000000 -0600
@@ -52,7 +52,7 @@

begin
Dir.glob(File.join(gem_dir, "*")) do |file|
- next unless file =~ /.*-[0-9]+\..*/
+ next unless test ?f, file and file =~ /.*-[0-9]+\..*/
FileUtils.mv(file, File.join(gem_dir, "gems"))
end
rescue


-a
--
===============================================================================
| EMAIL :: Ara [dot] T [dot] Howard [at] noaa [dot] gov
| PHONE :: 303.497.6469
| A flower falls, even though we love it;
| and a weed grows, even though we do not love it.
| --Dogen
===============================================================================
 
J

Jim Weirich

Ara.T.Howard said:
i get this running install.rb

ERROR: Failed to migrate the old gems located in...
/dmsp/reference/ruby-1.8.1/lib/ruby/gems/1.8
...to the /dmsp/reference/ruby-1.8.1/lib/ruby/gems/1.8/gems directory
You should move them manually, or your gems DB will be an invalid state

Hi Ara!

This is what is happening: Way back when rubygems started, we dumped
information directly into the .../ruby/gems/1.8 directory. As the
project matured and more information was added to that directory, it
because obvious that the installed gem directories really ought to be
installed in subdirectory (namely .../ruby/gems/1.8/gems). At that time
the installer was written to automatically migrate old gem repositories
to the new format.

Unfortunately in reviewing the code for the installer, I see the
criteria used to move the files checks for a dash/digit in the file
name. Since your directory path includes "ruby-1" in it, the criteria
is falsely triggered and an incorrect file (I think it is the cache
directory from your backtrace) is attempted to be moved.

The install continues normally after that point, so unless you _really_
do have old gems in the .../ruby/gems/1.8 directory, your install should
be fine.

I've added the install bug to my bug list.

Thanks for the feedback.
 
J

Jim Weirich

Jim said:
Unfortunately in reviewing the code for the installer, I see the
criteria used to move the files checks for a dash/digit in the file
name. [...]

I've added the install bug to my bug list.

Fixed in CVS (if you want to try it out)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,981
Messages
2,570,188
Members
46,731
Latest member
MarcyGipso

Latest Threads

Top