`uru admin refresh` fails if a ruby directory is missing.

Issue #36 resolved
Luis Lavena created an issue

I removed a ruby directory by mistake and uru failed to complete admin refresh command:

C:\Users\Luis>uru ls
    187p371     : ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mingw32]
    187p374     : ruby 1.8.7 (2013-06-27 patchlevel 374) [i386-mingw32]
    192p290     : ruby 1.9.2p290 (2011-07-09) [i386-mingw32]
    193p429     : ruby 1.9.3p429 (2013-05-15) [i386-mingw32]
    193p448     : ruby 1.9.3p448 (2013-06-27) [i386-mingw32]
    200p195     : ruby 2.0.0p195 (2013-05-14) [i386-mingw32]
    200p195-x64 : ruby 2.0.0p195 (2013-05-14) [x64-mingw32]
    200p247     : ruby 2.0.0p247 (2013-06-27) [i386-mingw32]
    200p247-x64 : ruby 2.0.0p247 (2013-06-27) [x64-mingw32]
C:\Users\Luis>uru -debug=true admin refresh
2013/07/07 14:23:13 [DEBUG] initializing uru v0.6.1
2013/07/07 14:23:13 [DEBUG] uru HOME is C:\Users\Luis\.uru
2013/07/07 14:23:13 [DEBUG] === ctx.Registry.Rubies ===
map[149366990:{ID:2.0.0-p247 TagLabel:200p247 Exe:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-2.0.0-p247-i386-mingw32\bin Ge
mHome: Description:ruby 2.0.0p247 (2013-06-27) [i386-mingw32]} 2742197238:{ID:1.8.7-p374 TagLabel:187p374 Exe:ruby Home:
C:\Users\Luis\Tools\Ruby\ruby-1.8.7-p374-i386-mingw32\bin GemHome: Description:ruby 1.8.7 (2013-06-27 patchlevel 374) [i
386-mingw32]} 2823172277:{ID:2.0.0-p195 TagLabel:200p195 Exe:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-2.0.0-p195-i386-min
gw32\bin GemHome: Description:ruby 2.0.0p195 (2013-05-14) [i386-mingw32]} 3004300164:{ID:1.9.3-p448 TagLabel:193p448 Exe
:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-1.9.3-p448-i386-mingw32\bin GemHome: Description:ruby 1.9.3p448 (2013-06-27) [i
386-mingw32]} 306969846:{ID:2.0.0-p247 TagLabel:200p247-x64 Exe:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-2.0.0-p247-x64-m
ingw32\bin GemHome: Description:ruby 2.0.0p247 (2013-06-27) [x64-mingw32]} 3440111247:{ID:1.9.2-p290 TagLabel:192p290 Ex
e:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-1.9.2-p290-i386-mingw32\bin GemHome: Description:ruby 1.9.2p290 (2011-07-09) [
i386-mingw32]} 3823836226:{ID:1.9.3-p429 TagLabel:193p429 Exe:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-1.9.3-p429-i386-mi
ngw32\bin GemHome: Description:ruby 1.9.3p429 (2013-05-15) [i386-mingw32]} 3803376037:{ID:2.0.0-p195 TagLabel:200p195-x6
4 Exe:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-2.0.0-p195-x64-mingw32\bin GemHome: Description:ruby 2.0.0p195 (2013-05-14
) [x64-mingw32]} 596636032:{ID:1.8.7-p371 TagLabel:187p371 Exe:ruby Home:C:\Users\Luis\Tools\Ruby\ruby-1.8.7-p371-i386-m
ingw32\bin GemHome: Description:ruby 1.8.7 (2012-10-12 patchlevel 371) [i386-mingw32]}]
2013/07/07 14:23:13 [DEBUG] cmd = admin
---> Unable to determine ruby metadata while refreshing

Several Rubies were removed (1.9.2, 1.8.7, etc), the only remaining installed were:

ruby-1.8.7-p374-i386-mingw32
ruby-1.9.3-p448-i386-mingw32
ruby-2.0.0-p247-i386-mingw32
ruby-2.0.0-p247-x64-mingw32

Comments (7)

  1. Jon repo owner

    TODO

    1. stat home dir for each refresh iteration
    2. don't exit iteration and corrupt the registry if home dir stat fails; warn, remove missing ruby from updated registry, and continue refreshing the remaining registered rubies
    3. end result: updated json ruby registry contains refreshed info for rubies with existing home dirs; all previously registered rubies that are now missing a home dir will be deregistered
  2. Jon repo owner

    If you're feeling adventurous, I just dropped an untested windows uru-0.6.2.alpha1 on the download page.

    I'll test it tomorrow. Let me know how it works for you.

  3. Jon repo owner

    Did 0.6.2.alpha1 (a) work for you, and (b) appear to be the correct fix from an end user perspective?

  4. Luis Lavena reporter

    Works like a charm:

    C:\Users\Luis>uru admin refresh
    ---> refreshing ruby tagged as `200p247`
    ---> refreshing ruby tagged as `187p374`
    ---> refreshing ruby tagged as `193p448`
    ---> refreshing ruby tagged as `200p247`
    ---> ruby tagged as `187p370` does not exist; deregistering
    
  5. Log in to comment