Search code examples
rubyrbenv

local ruby version not registering in gemfile


The Ruby project that I'm trying to run specifies a requirement for Ruby version 2.1.2 in the Gemfile. Accordingly, I installed that version using rbenv and set it as the version for that repo using rbenv's local command. However, even after powering off my computer and restarting (not to mention running rbenv rehash), I still can't start the project, however rbenv confirms that I'm running 2.1.2 in that directory

bundle exec foreman start
Your Ruby version is 2.0.0, but your Gemfile specified 2.1.2
travis-web > rbenv version
2.1.2 (set by /Users/me/sites/travis-web/.ruby-version)

Do you know how I can get the gemfile to read/acknowledge the local version (2.1.2)?


Solution

  • Switching versions might have dropped your bundler. The previous version had it, the new one doesn't. See here for another related case.

    Within that repo:

    • gem install bundler
    • rbenv rehash

    rbenv-bundler is a handy library that can do this for you upon each bundle install