Search code examples
ruby-on-railsrbenv

"can't find gem" error when trying to create a new rails 5.1.4 project


rails new works fine. However, when I try to create a new rails project using rails _5.1.4_ new I get this error:

can't find gem railties (= 5.1.4) with executable rails (Gem::GemNotFoundException)

I'm using rbenv on Ubuntu 18.04

I'm running a rails 5.1.4 project on this PC, which works fine, just creating a new one doesn't work.


Solution

  • The error suggested that you don't have Rails 5.1.4 installed in your system. Try install it by gem install rails -v 5.1.4 and then rails _5.1.4_ new NewAPP again.