Search code examples
ruby-on-railsrubyrbenv

Ruby on Rails does not use the version defined in rbenv


I want to use version 2.2.2 of Ruby, then

r2d2@r2d2-acer ~/ApenasMeu/myapp $ rbenv global
system
r2d2@r2d2-acer ~/ApenasMeu/myapp $ rbenv versions
  system
* 2.2.2 (set by RBENV_VERSION environment variable)

However, the default home page of RoR, it appears that use this version:

Ruby version 1.9.3-p484 (x86_64-linux)

How to solve it?


Solution

  • If you're using bundler you can specify the ruby version in your Gemfile - just add a line like ruby "2.2.2" to your Gemfile (I've always seen it at/near the top - not sure if this is required or just convention) and run bundle install.