0

我最近安装了 RVM。加载我的后,.rvmrc我尝试bundle install并收到错误消息,通知我bundler未安装。

安装后bundlerbundler未安装错误仍然存​​在。经过一些快速挖掘后,我发现 ruby​​gems 没有使用 RVM gem 路径。

这里是gem env

RubyGems Environment:
  - RUBYGEMS VERSION: 1.8.24
  - RUBY VERSION: 1.9.2 (2011-07-09 patchlevel 290) [x86_64-linux]
  - INSTALLATION DIRECTORY: /home/jhalecom/ruby/gems
  - RUBY EXECUTABLE: /home/jhalecom/.rvm/rubies/ruby-1.9.2-p290/bin/ruby
  - EXECUTABLE DIRECTORY: /home/jhalecom/ruby/gems/bin
  - RUBYGEMS PLATFORMS:
    - ruby
    - x86_64-linux
  - GEM PATHS:
     - /home/jhalecom/ruby/gems
  - GEM CONFIGURATION:
     - :update_sources => true
     - :verbose => true
     - :benchmark => false
     - :backtrace => false
     - :bulk_threshold => 1000
     - "gem" => "--remote --gen-rdoc --run-tests"
     - "gemhome" => "/home/jhalecom/ruby/gems"
     - "gempath" => []
     - "rdoc" => "--inline-source --line-numbers"
  - REMOTE SOURCES:
     - http://rubygems.org/

这里是~/.bashrc

# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi

# User specific aliases and functions


[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"

这里是~/.bash_pofile

# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi

# User specific environment and startup programs

PATH=$PATH:$HOME/bin

export PATH
4

1 回答 1

1

你需要清理你的~/.gemrc,它会改变路径,最好是用重写它:

echo gem: --gen-rdoc --run-tests > ~/.gemrc
echo rdoc: --inline-source --line-numbers >> ~/.gemrc

或删除错误的行:

sed -i '/gemhome|gempath/ d;'
于 2012-08-30T20:39:53.410 回答