Search code examples
ruby-on-railsrubyruby-on-rails-4rbenv

rails rbenv: rails: command not found


I have recently moved from RVM to Rbenv and when attempting to execute rails I am getting an error like the one below

Pauls-Air:~ $ rails
rbenv: rails: command not found

The `rails' command exists in these Ruby versions:
  2.1.2

Solution

  • After installing a gem via the command line in a ruby version you have to execute rbenv rehash as described in the docs here and here

    For example:

    $ rbenv install 2.2.0
    $ gem install bundler
    $ rbenv rehash
    $ gem install rails
    $ rbenv rehash