捆绑安装不使用rbenv本地Ruby版本 [英] Bundle install not using rbenv local Ruby version
问题描述
我正在尝试使用捆绑器为新的Rails项目安装gems:
I am trying to install gems for a new Rails project using bundler:
$ bundle install --path
我已使用rbenv将本地Ruby版本设置为2.3.1,但bundler仍在使用系统Ruby(2.0.0).
I've set my local Ruby version to 2.3.1 using rbenv, but bundler is still using my system Ruby (2.0.0).
$ rbenv local
2.3.1
$ echo $PATH
/Users/jenniferpierce/.rbenv/shims:/Users/jenniferpierce/.rbenv/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/PostgreSQL/9.5/bin
$ which ruby
/Users/jenniferpierce/.rbenv/shims/ruby
$ ruby -v
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]
$ bundle install --path
Your Ruby version is 2.0.0, but your Gemfile specified 2.3.1
我的bash个人资料包括:
My bash profile includes:
export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"
我已经跑步:
$ rbenv rehash
,然后重新启动我的终端.也许我缺少一些明显的东西?任何想法将不胜感激.
and restarted my terminal. Maybe I'm missing something super obvious? Any ideas would be appreciated.
推荐答案
您应该能够只运行bundle install
而无需--path.我相信--path允许您指定与系统中的路径不同的路径,但是如果您按照建议修改了bash配置文件,则无需这样做.
You should be able to just run bundle install
without the --path. I believe --path allows you to specify a different path than the one in your system, but if you modified your bash profile as you suggested, there is no need for that.
此外,如果您只是更改了本地文件夹的ruby版本,则应运行gem install bundler
.
Also, if you just changed your ruby version for the local folder, you should run a gem install bundler
.
这篇关于捆绑安装不使用rbenv本地Ruby版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!