Skip to content

rails new fails to read my Ruby version and won't create a new project #27569

@jodosha

Description

@jodosha

Steps to reproduce

➜ gem install rails
➜ rails new hello_domains

    Rails 5 requires Ruby 2.2.2 or newer.

    You're running
      ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

    Please upgrade to Ruby 2.2.2 or newer to continue.

Expected behavior

It should generate the project.

Actual behavior

It refuses to generate the project because it reads a wrong version of Ruby.

It's worth mentioning that I'm using chruby. My three versions installed are:

➜ chruby
   jruby-9.1.6.0
   ruby-2.3.3
 * ruby-2.4.0

But rails bin reads the "system" Ruby instead:

➜ chruby system
➜ ruby -v
ruby 2.0.0p648 (2015-12-16 revision 53162) [universal.x86_64-darwin15]

Please note that when I'm trying to create the new project, my current Ruby version is 2.4 (as shown above).

System configuration

Rails version:

5.0.1

Ruby version:

ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-darwin15] (installed via ruby-install)
chruby: stable 0.3.9 (bottled), HEAD (installed via Homebrew)

Metadata

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