Skip to content

Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 #400

Closed
@ichilton

Description

I'm trying to run a rake task on a rails app, and am getting this error:

/home/vagrant/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/definition.rb:361:in     `validate_ruby!': Your Ruby version is 1.9.3, but your Gemfile specified 2.0.0 (Bundler::RubyVersionMismatch)
    from /home/vagrant/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler.rb:116:in `setup'
    from /home/vagrant/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0/gems/bundler-1.3.5/lib/bundler/setup.rb:17:in `<top (required)>'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
    from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
rake aborted!

As you can see from the paths in the error though, I am running 2.0.0:

$ ruby -v
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-linux]

$ bundle -v
Bundler version 1.3.5

$ gem env
RubyGems Environment:

  • RUBYGEMS VERSION: 2.0.3
  • RUBY VERSION: 2.0.0 (2013-05-14 patchlevel 195) [x86_64-linux]
  • INSTALLATION DIRECTORY: /home/vagrant/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0
  • RUBY EXECUTABLE: /home/vagrant/.rbenv/versions/2.0.0-p195/bin/ruby
  • EXECUTABLE DIRECTORY: /home/vagrant/.rbenv/versions/2.0.0-p195/bin
  • RUBYGEMS PLATFORMS:
    • ruby
    • x86_64-linux
  • GEM PATHS:
    • /home/vagrant/.rbenv/versions/2.0.0-p195/lib/ruby/gems/2.0.0
    • /home/vagrant/.gem/ruby/2.0.0
  • GEM CONFIGURATION:
    • :update_sources => true
    • :verbose => true
    • :backtrace => false
    • :bulk_threshold => 1000
  • REMOTE SOURCES:

I tried doing rbenv global 2.0.0-p195, but that didn't help. Looks like it might be trying to use system ruby instead of rbenv for some reason?

Raised an issue with bundler: rubygems/bundler#2489 but it seems to be an rbenv issue.

rake is a rbenv shim at: ~/.rbenv/shims/rake

Thanks,

Ian

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions