捆绑包未使用 rbenv 版本

Ant*_*yrd 0 ruby macos rbenv

我正在尝试使用 rbenv 进行捆绑。当我检查 ruby​​ 版本时,它给了我 2.4.0,rbenv。但是当调用 bundle 时,它​​使用默认安装的 osx 版本。

MacBook-Pro-256:kittens-or-puppies antarrbyrd$ bundle
Your Ruby version is 2.0.0, but your Gemfile specified 2.4.0
MacBook-Pro-256:kittens-or-puppies antarrbyrd$ ruby -v
ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin16]
Run Code Online (Sandbox Code Playgroud)

Die*_*zar 5

rbenv rehash

rehash 命令更新包二进制文件的垫片。

确保您已将此添加到您的 .bash_profile

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
Run Code Online (Sandbox Code Playgroud)

还可以尝试卸载 bundler 并重新安装它,然后运行rehash.

http://dan.carley.co/blog/2012/02/07/rbenv-and-bundler/