不能sudo gem卸载(你没有写权限)

时间:2010-06-18 22:30:08

标签: ruby-on-rails permissions rubygems uninstall

我在从系统中删除宝石时遇到问题。当我问gem安装RedCloth时,它说:

    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 个答案:

答案 0 :(得分:1)

我跑了

gem cleanup 

然后输入

gem list -d RedCloth 

显示了这个

*** 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/

看起来它不是真的在以前的位置。