安装RVM后无法使用gem

时间:2012-07-09 14:43:11

标签: ruby rubygems gem rvm

我正在使用Arch Linux和Zsh。 我按照官方文档安装了RVM:

$ curl -L https://get.rvm.io | bash -s stable --ruby
$ echo '[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"' >> ~/.zshrc
$ source ~/.zshrc
$ rvm use 1.9.2 --default

安装RVM后。我安装的每个gem都会显示 Gem :: LoadError 错误,如下所示:

$ gem install huami
$ huami
/home/meck/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:247:in `to_specs': Could not find huami (>= 0) amongst [] (Gem::LoadError)
from /home/meck/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems/dependency.rb:256:in `to_spec'
from /home/meck/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/site_ruby/1.9.1/rubygems.rb:1231:in `gem'
from /home/meck/.gem/ruby/1.9.1/bin/huami:22:in `<main>'

宝石清单是空的:

$ gem list

*** LOCAL GEMS ***

这是我的宝石环境:

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

有人能指出我错过了哪一步吗?

1 个答案:

答案 0 :(得分:0)

使用oh-my-zsh,RVM无法正常工作。 oh-my-zsh喜欢控制很多你的shell体验。你的里程会有所不同。某些扩展将与RVM的操作冲突。如果您遇到问题,请参加IRC Freenode #rvm,因为他们可以提供直接和快速的帮助哦-my-zsh。