This message means that Rails cannot be found. This might be due to the fact that you haven’t installed Rails or it may be due to the fact that the path to Rails cannot be found.
This might be the conflict of ruby of ruby path not set properly
Uninstall and Re-Install the ruby
Remove all version of rails
Then, run the gem from the system prompt, you should enter:
gem install rails –include-dependencies
Alternatively, you can download and install rails from the Ruby On Rails web site:
To make sure that Rails is installed, go to the system prompt and enter: