0

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)?

Leahcim
  • 40,649
  • 59
  • 195
  • 334
  • Do you have it installed? Just because it's in your version file doesn't mean it exists on your system. Ruby --version confirms what's running. – Dave Newton Jan 15 '15 at 16:46
  • @DaveNewton it's listed when I run `rbenv install -l` and when I try to install it again, it says it already exists – Leahcim Jan 15 '15 at 21:00
  • What do you get when you run `ruby --version`? – dpassage Jan 18 '15 at 00:02
  • @dpassage when I run `ruby --version` in that repo, I get `ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin14.0]` when I run `ruby --version` in a different repo (i.e. any other repo), I get `ruby 2.0.0p481 (2014-05-08 revision 45883) [universal.x86_64-darwin14]`. Reminder, I set the local version for that repo (the problem repo) to be 2.1.2, so the results of `ruby --version` are what I'd expect – Leahcim Jan 18 '15 at 01:00
  • @JesseSielaff `which bundle` gives `/usr/bin/bundle` – Leahcim Jan 18 '15 at 15:22

1 Answers1

0

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

Community
  • 1
  • 1
Joseph Sawyer
  • 463
  • 3
  • 11
  • Your answer solved the issue, but I have to wait 8 hours to award the bounty. Will come back. Thanks. – Leahcim Jan 18 '15 at 15:31