简体   繁体   English

Rails在Windows中无法通过命令行找到生成器

[英]Rails Could not find generator via command line in Windows

I'm brand new in Ruby. 我是Ruby的新手。 I'm following this Ruby tutorial. 我正在关注这个Ruby教程。 Everything seems fine till 4.1, but in 4.2 when I run ruby bin\\rails generate controller welcome index in cmd, it says Could not find generator welcome. 在4.1之前一切似乎都很好,但是在4.2中,当我在cmd中运行ruby bin\\rails generate controller welcome index时,它说找不到生成器欢迎。 Following are my windows setup details: 以下是我的Windows设置详细信息:

Ruby version: 2.1.5 Ruby版本:2.1.5

Rails version: 4.1.8 Rails版本:4.1.8

Please forgive my silly mistakes if there are any. 如果有任何错误,请原谅我的愚蠢错误。

its for Linux 适用于Linux

$ bin/rails generate controller welcome index

for windows try 对于Windows尝试

$ rails generate controller welcome index

the later one also works for other OSes. 后者也适用于其他操作系统。 or for more info try 或了解更多信息,请尝试

rails g controller --help

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM