我正在使用OSX 10.8.4
我尝试使用以下方式设置我的全局ruby版本:
$ rbenv global 1.9.3-p429
$ rbenv version
>> 1.9.3-p194 (set by /Users/emailnitram/.ruby-version)
我的PATH看起来像这样:
/Users/emailnitram/.rbenv/shims:/Users/emailnitram/.rbenv/bin:/usr/local/opt/ruby/bin:/usr/local/heroku/bin:/Users/emailnitram/Sites/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/usr/local/git/bin:/Users/emailnitram/.rbenv/shims:/Users/emailnitram/.rbenv/bin:/usr/local/opt/ruby/bin:/usr/local/heroku/bin:/Users/emailnitram/Sites/bin
我试过看rbenv not changing ruby version并按照说明确保我的〜/ .bash_profile
中有以下内容export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
我仍然需要设置rbenv local 1.9.3-p429
才能让它工作
答案 0 :(得分:0)
今天安装ruby 2.6.5时,我遇到了同样的问题。
重新安装了rbenv,并从任何gem env
关键字中清除了我的bash_profile,bashrc和zshrc(我使用zsh)。重新开始。
我仍然遇到相同的问题,但是在RubyGems Environment:
- RUBYGEMS VERSION: 3.1.2
- RUBY VERSION: 2.6.3 (2019-04-16 patchlevel 62) [x86_64-linux]
- INSTALLATION DIRECTORY: /home/johnarvi/.rvm/gems/ruby-2.6.3
- USER INSTALLATION DIRECTORY: /home/johnarvi/.gem/ruby/2.6.0
- RUBY EXECUTABLE: /usr/share/rvm/rubies/ruby-2.6.3/bin/ruby
- GIT EXECUTABLE: /usr/bin/git
- EXECUTABLE DIRECTORY: /home/johnarvi/.rvm/gems/ruby-2.6.3/bin
- SPEC CACHE DIRECTORY: /home/johnarvi/.gem/specs
- SYSTEM CONFIGURATION DIRECTORY: /etc
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /home/johnarvi/.rvm/gems/ruby-2.6.3
- /usr/share/rvm/rubies/ruby-2.6.3/lib/ruby/gems/2.6.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/
- SHELL PATH:
- /home/johnarvi/.rvm/gems/ruby-2.6.3/bin
- /home/johnarvi/.rvm/gems/ruby-2.6.3@global/bin
- /usr/share/rvm/rubies/ruby-2.6.3/bin
- /usr/share/rvm/bin
- /home/linuxbrew/.linuxbrew/bin
- /home/linuxbrew/.linuxbrew/sbin
- /home/johnarvi/.nvm/versions/node/v10.16.1/bin
- /home/linuxbrew/.linuxbrew/bin
- /home/linuxbrew/.linuxbrew/sbin
- /usr/local/sbin
- /usr/local/bin
- /usr/sbin
- /usr/bin
- /sbin
- /bin
- /usr/games
- /usr/local/games
- /snap/bin
(或您运行的任何版本)之后,您需要运行rehash(rbenv
)。
之后,当我执行rbenv install 2.6.5
时,它将显示最新消息,并且一切正常?