2009-10-30 62 views
3

我跑了「gem sources -c」,這樣我就不得不故意指定我要安裝gem的位置,因爲我現在有3個不同的gem安裝源 - RubyForge,Github和Gemcutter。我通過運行「gem sources -c」實際刪除了什麼?

C:\>gem sources -c 
*** Removed specs cache *** 
*** Removed user source cache *** 
*** Removed latest user source cache *** 
*** Removed system source cache *** 
*** Removed latest system source cache *** 

運行此命令後,我又跑gem sources,以確保我不再有任何默認的來源,我得到這個:

C:\>gem sources 
*** CURRENT SOURCES *** 

http://gems.rubyforge.org 
http://gems.github.com 
http://gems.rubyforge.org/ 
http://gemcutter.org 

換句話說,一切都沒有改變

縱觀幫助gem sources -c下面這似乎是正確的命令立刻刪除所有的寶石來源:

-c, --clear-all     Remove all sources (clear the cache) 

否則,看來你必須逐個刪除一個。 沒有什麼大不了的,因爲我只有4個,但我想知道我通過做「gem sources -c刪除了什麼。

C:\>gem sources --help 
Usage: gem sources [options] 

    Options: 
    -a, --add SOURCE_URI    Add source 
    -l, --list      List sources 
    -r, --remove SOURCE_URI   Remove source 
    -c, --clear-all     Remove all sources (clear the cache) 
    -u, --update      Update source cache 

    Local/Remote Options: 
    -p, --[no-]http-proxy [URL]  Use HTTP proxy for remote operations 

    Common Options: 
    -h, --help      Get help on this command 
    -V, --[no-]verbose    Set the verbose level of output 
    -q, --quiet      Silence commands 
     --config-file FILE   Use this config file instead of default 
     --backtrace     Show stack backtrace on errors 
     --debug      Turn on Ruby debugging 

回答

1

對於每個源rubygems保存本地緩存有關在每個源等託管的寶石的信息等加快操作,該命令只是清除這些緩存。

望着RubyGems的來源,我的系統例如在刪除

C:/Users/Kris/.gem/specs 
C:/Users/Kris/.gem/source_cache 
C:/Users/Kris/.gem/latest_source_cache 
C:/Ruby/lib/ruby/gems/1.8/source_cache 
C:/Ruby/lib/ruby/gems/1.8/latest_source_cache 

你還是得自己刪除的實際來源。

相關問題