正确安装rbenv后为什么我看不到gem列表?

时间:2013-10-25 14:10:28

标签: ruby-on-rails ruby gem rbenv

我使用rbenv安装了homebrew并安装了2.0.0p347之后我在项目文件夹中运行bundle install,并将我的gem安装到vendor/bundle。但是当我跑gem list时,我看不到它们。

myproject(开发)»rbenv版本   系统 * 2.0.0-p247(由/Users/rege/Code/myproject/.ruby-version设置)

我也运行rbenv rehash

我的配置:

~» echo $PATH.
/Users/rege/.gem/bin:/Users/rege/.rbenv/shims:/Users/rege/.rbenv/bin:/usr/local/heroku/bin:/usr/local/bin:/Users/rege/.rbenv/shims:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin.

.zshrc
if which rbenv > /dev/null; then eval "$(rbenv init -)"; fi
# Gem
export GEM_HOME="$HOME/.gem"
export GEM_PATH="$HOME/.gem"
### PATH
export PATH="/usr/local/bin:$PATH"
export PATH="/usr/local/heroku/bin:$PATH"
export PATH=$(rbenv root)/shims:$(rbenv root)/bin:$PATH
export PATH="$HOME/.gem/bin:$PATH"

~» gem env
RubyGems Environment:
  - RUBYGEMS VERSION: 2.1.10
  - RUBY VERSION: 2.0.0 (2013-06-27 patchlevel 247) [x86_64-darwin13.0.0]
  - INSTALLATION DIRECTORY: /Users/rege/.gem
  - RUBY EXECUTABLE: /Users/rege/.rbenv/versions/2.0.0-p247/bin/ruby
  - EXECUTABLE DIRECTORY: /Users/rege/.gem/bin
  - SPEC CACHE DIRECTORY: /Users/rege/.gem/specs
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-darwin-13
  - GEM PATHS:
     - /Users/rege/.gem
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--no-ri --no-rdoc"
  - REMOTE SOURCES:
     - https://rubygems.org/
  - SHELL PATH:
     - /Users/rege/.rbenv/versions/2.0.0-p247/bin
     - /usr/local/Cellar/rbenv/0.4.0/libexec
     - /Users/rege/.gem/bin
     - /Users/rege/.rbenv/shims
     - /Users/rege/.rbenv/bin
     - /usr/local/heroku/bin
     - /usr/local/bin
     - /Users/rege/.rbenv/shims
     - /usr/bin
     - /bin
     - /usr/sbin
     - /sbin
     - /usr/local/bin

myproject(development)» which bundle
/Users/rege/.gem/bin/bundle

1 个答案:

答案 0 :(得分:0)

检查您的有效宝石集rbenv gemset active,也许您指的是错误的宝石集。要检查可用的gemset,请触发此rbenv gemset list