2010-06-18 81 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