简体   繁体   English

无法使用rbenv运行正确的Ruby版本

[英]Can't run the correct Ruby version with rbenv

After installing rbenv , I wanted to switch to the correct Ruby version to work on a project, but there seems to be an issue recognizing it. 安装rbenv ,我想切换到正确的Ruby版本以在项目上工作,但是识别它似乎有问题。

$ cd project/
$ bundle install
$ Your Ruby version is 2.0.0, but your Gemfile specified 2.1.1
$ rbenv local
$ rbenv: no local version configured for this directory
$ rbenv global
$ 2.1.1
$ ruby --version
$ ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin13.0]

Am I overlooking something? 我在俯视什么吗?

There was an issue with my $PATH variable. 我的$PATH变量存在问题。

This worked for me (in .bash_profile ): 这为我工作(在.bash_profile ):

export PATH="/usr/local/bin:$PATH"
eval "$(rbenv init -)"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM