"can't find gem" 尝试创建新的 rails 5.1.4 项目时出错

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

rails new 工作正常。但是,当我尝试使用 rails _5.1.4_ new 创建一个新的 rails 项目时,出现了这个错误:

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

我在 Ubuntu 18.04

上使用 rbenv

我是 运行 这台 PC 上的一个 rails 5.1.4 项目,它工作正常,只是创建一个新项目不起作用。

错误表明您的系统中没有安装Rails 5.1.4。尝试通过 gem install rails -v 5.1.4 安装它,然后再次 rails _5.1.4_ new NewAPP