Alex Reinking Alex Reinking - 5 months ago 40
Ruby Question

Bundler detects wrong version of Ruby

I'm sure this has been asked before, but even after many hours researching I have no idea what could be wrong.

If try to run any bundle command, I get the following error message:

Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0


Yet, the output of
ruby-switch --check
says otherwise:

Currently using: ruby2.0
------------------------

ruby -> /usr/bin/ruby2.0
gem -> /usr/bin/gem2.0


and so does the output of
rvm list
:

rvm rubies

=* ruby-2.0.0-p247 [ x86_64 ]

# => - current
# =* - current && default
# * - default


and even
gem env
:

RubyGems Environment:
- RUBYGEMS VERSION: 2.0.7
- RUBY VERSION: 2.0.0 (2013-08-29 patchlevel 299) [x86_64-linux-gnu]
- INSTALLATION DIRECTORY: /var/lib/gems/2.0.0
- RUBY EXECUTABLE: /usr/bin/ruby2.0
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86_64-linux
- GEM PATHS:
- /var/lib/gems/2.0.0
- /home/alex/.gem/ruby/2.0.0
- /usr/share/rubygems-integration/2.0.0
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :backtrace => false
- :bulk_threshold => 1000
- REMOTE SOURCES:
- https://rubygems.org/


I'm running Bundler version 1.3.5. Why isn't it recognizing the correct version of Ruby?

Answer

All that system ruby information showing up sure makes it seem like RVM is not installed, or is improperly installed. Fixing it sounds like no fun. I'd recommend blowing it away and starting over.

rvm implode
rm -rf ~/.rvm
# check .profile, .bash_profile for remnants of rvm, nuke them too

Then follow the RVM installation instructions to the letter.