Jen Pierce Jen Pierce - 1 year ago 103
Ruby Question

Bundle install not using rbenv local Ruby version

I am trying to install gems for a new Rails project using bundler:

$ bundle install --path

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

$ echo $PATH

$ which 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

My bash profile includes:

export PATH="$HOME/.rbenv/bin:$PATH"
eval "$(rbenv init -)"

I've run:

$ rbenv rehash

and restarted my terminal. Maybe I'm missing something super obvious? Any ideas would be appreciated.

Answer Source

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.

Also, if you just changed your ruby version for the local folder, you should run a gem install bundler.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download