Search code examples
ruby-on-railsrubymacosrbenv

Having trouble with Ruby versions - rbenv


I recently updated my computer to Mac OS X El Capitan and had to reinstall homebrew and rbenv.

When I go to bundle install in one of my rails app and run bundle install I get: "Your Ruby version is 2.0.0, but your Gemfile specified 2.2.0".

However, when I do ruby-v I get: ruby 2.2.0p0 . Why am I seeing two different versions and how can I change it?


Solution

  • rbenv -h will tell you what to do.

    "rbenv versions" List all Ruby versions available to rbenv

    "rbenv global" Set or show the global Ruby version

    "rbenv local" Set or show the local application-specific Ruby version

    to set, just do "rbenv local 2.2.0" or "rbenv global 2.2.0"

    Also, there is the .ruby-version file that can also set ruby version.

    Look at the instructions from rbenv main github page for more info. They do a pretty good job describing how to set the active ruby version. https://github.com/sstephenson/rbenv