Search code examples
ruby-on-railsrubyrbenv

After installing ruby 2.2.3 with rbenv it has a different version


I'm trying to use Rails 5, which requires Ruby version >= 2.2.2.

I installed 2.2.3 with rbenv install 2.2.3 and set it global. When I check with ruby -v I get ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15].

However when I run bundle exec railties/exe/rails new /parent-folder/api --api --edge I get the error:

Rails 5 requires Ruby 2.2.2 or newer.

You're running
  ruby 2.1.1p76 (2014-02-24 revision 45161) [x86_64-darwin14.0]

If I explicitly set the local version to the exact version number 2.2.3p173 or 2.2.3 then it says rbenv: version '2.2.3' is not installed (or 2.2.3p173 accordingly).

When I perform rbenv install -l to check available versions only 2.2.3 is listed, not the 2.2.3p173.

Don't understand how to get this to work.

Side notes: I have updated ruby build, my $PATH has rbenv setup correctly, I don't have rvm installed.


Solution

  • Instead of bundle exec railties/exe/rails new /parent-folder/api --api --edge try ./rails/railties/exe/rails new myapp --edge --dev where 'rails' is the rails git repo.