Ruby On Rails 脚手架加载错误

发布于 2024-08-22 04:09:38 字数 392 浏览 4 评论 0原文

我正在使用我拿起的一本名为“Head First Rails”的书学习 Ruby on Rails,我在第一章,它告诉我使用以下命令创建我的 CRUD 过程:

ruby script/generate scaffold ticket name:string seat_id_seq:string address:text price_paid:decimal email_address:string

我收到的错误是:

ruby​​:没有这样的文件或目录 -- script/generate (LoadError)

有人可以解释一下我做错了什么吗?我对开发并不陌生,我是一名专业的 C# 开发人员,正在尝试学习 Ruby on Rails。

I am learning Ruby on Rails using a book I picked up called "Head First Rails" I am in the first chapter and it tells me to create my CRUD procedures using the following command:

ruby script/generate scaffold ticket name:string seat_id_seq:string address:text price_paid:decimal email_address:string

the error I am getting is:

ruby: No such file or directory -- script/generate (LoadError)

Can someone please explain what I am doing wrong. I am not new to development, I am a professional C# developer trying to learn Ruby on Rails.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

记忆で 2024-08-29 04:09:38

您是否在应用程序目录中运行它?需要在应用程序目录中执行scaffold命令才能找到script/generate。

Are you running that in your application directory? The scaffold command needs to be executed in your application directory in order to find script/generate.

惯饮孤独 2024-08-29 04:09:38

尝试在项目目录中简单地使用“./script/generate ...”

try simply "./script/generate ..." in your project directory

七堇年 2024-08-29 04:09:38

这个问题很老了,但是对于任何遇到“Head First Rails”第一版(目前唯一可用的)问题的人来说,它是为 Rails 2 编写的。所以大多数命令,如 script/generate,已被 Rails 3 中的新内容取代。

我建议使用“Agile Web Development with Rails”一书。

This question is old, but for anyone who is having problems with "Head First Rails" first edition (which is the only one available at this time), it was written for rails 2. So most of the commands, like script/generate, have been replaced by new ones in Rails 3.

I suggest using "Agile Web Development with Rails" book.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文