Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby Build a Todo List Application with Rails 4 Build a Todo List Application with Rails 4 Relationships

David Forero
David Forero
5,492 Points

Hello, I am getting the following error: "Could not find generator model todo_item."

When I run bin/rails generate modeltodo_item todo_list:references content:string Not sure what happens. I run the bundle and everything else till that spot.

2 Answers

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

Try omitting the bin/, copy and run this:

rails g model todo_item todo_list:references content:string
David Forero
David Forero
5,492 Points

Maciej thanks for your prompt response, however it has not worked. Not sure what is wrong.

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

OK, try these lines:

rails g model TodoItem todo_list:references content:string

and

rails g model Todo_item todo_list:references content:string
David Forero
David Forero
5,492 Points

Thanks Maciej this worked out :

rails g model TodoItem todo_list:references content:string

why this one and not the standard one from the video?

Maciej Czuchnowski
Maciej Czuchnowski
36,441 Points

I'm not really sure. As far as I know, this is just an alternative syntax (with camel case and no underscores) and both commands should work.