2010-06-18 38 views
1

我無法從我的系統中刪除寶石。當我問在安裝RedCloth寶石就這樣說:無法sudo寶石卸載(您沒有寫入權限)

pteng01:trunk mike$ gem list -d RedCloth 

    *** LOCAL GEMS *** 

    RedCloth (3.0.4) 
     Author: why the lucky stiff 
     Rubyforge: http://rubyforge.org/projects/redcloth 
     Homepage: http://www.whytheluckystiff.net/ruby/redcloth/ 
     Installed at: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 

     RedCloth is a module for using Textile and Markdown in Ruby. Textile 
     and Markdown are text formats. A very simple text format. Another 
     stab at making readable text that can be converted to HTML. 
    pteng01:trunk mike$ 

我試圖

sudo gem uninstall --install-dir /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8 

和我得到這個錯誤

ERROR: While executing gem ... (Gem::FilePermissionError) 
You don't have write permissions into the /usr/lib/ruby/gems/1.8/bin directory. 

回答

1

我跑

gem cleanup 

和然後

gem list -d RedCloth shows this 

*** LOCAL GEMS *** 

RedCloth (4.2.3) 
    Author: Jason Garber 
    Rubyforge: http://rubyforge.org/projects/redcloth 
    Homepage: http://redcloth.org 
    Installed at: /opt/local/lib/ruby/gems/1.8 

    RedCloth-4.2.3 - Textile parser for Ruby. http://redcloth.org/ 

看起來確實不在以前的位置。

+1

如果'gem cleanup'運行並解決了問題,那麼您可能有幾個版本的gem,並且清除命令將刪除除最近的所有命令。 – 2010-06-19 00:22:05

+0

是的,是這樣的情況下,我試圖刪除舊版本,所以我可以去與新的,並保持心靈的安寧我沒有讓我的系統混亂。 – Mike 2010-06-19 01:13:16