Linux linux 小白 gem uninstall xxx 显示无权限

evan · 2012年11月15日 · 最后由 evan 回复于 2012年11月15日 · 4242 次阅读

环境:

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.2 (2012-04-20 patchlevel 320) [x86_64-linux]
  - INSTALLATION DIRECTORY: /usr/local/rvm/gems/ruby-1.9.2-p320
  - RUBY EXECUTABLE: /usr/local/rvm/rubies/ruby-1.9.2-p320/bin/ruby
  - EXECUTABLE DIRECTORY: /usr/local/rvm/gems/ruby-1.9.2-p320/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /usr/local/rvm/gems/ruby-1.9.2-p320
     - /usr/local/rvm/gems/ruby-1.9.2-p320@global
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
  - REMOTE SOURCES:
     - http://rubygems.org/

出错信息:

ERROR:  While executing gem ... (Gem::FilePermissionError)
    You don't have write permissions into the /usr/local/rvm/gems/ruby-1.9.2-p320 directory.

使用 root 账户又出现:

# gem uninstall xxx
The program 'gem' can be found in the following packages:
 * rubygems1.8
 * rubygems1.9.1
Try: apt-get install <selected package>

该怎么解决?我应该是 rubygems1.8 吧 怎么删掉 rubygems1.9,1 怕删错了环境崩溃。。

干嘛把 rvm 装 那里嘛~

@woaigithub sudo 说 sudo: gem: command not found

试试rvmsudo gem uninstall

@ywjno 谢谢!已解决!

需要 登录 后方可回复, 如果你还没有账号请 注册新账号