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 trialjoshua baker
2,276 Pointsbin/rails not working ?
When entering this line joshuas-MacBook-Pro:~ joshua$ bin/rails generate scaffold Post title:string I receive this response -bash: bin/rails: No such file or directory
What could be the problem?
3 Answers
Jay McGavren
Treehouse TeacherDoes running ls bin/
produce output like this?
$ ls bin/
bundle rails rake setup spring update
If you instead get ls: cannot access 'bin/': No such file or directory
, you need to change into your Rails app's directory before running bin/rails
.
joshua baker
2,276 PointsGot everything working. Thanks!
victor manda
Courses Plus Student 2,479 Pointsbin/rails scaffold post title:string rails aborted! Don't know how to build task 'scaffold' (see --tasks)
How do I fix this issue?
Jay McGavren
Treehouse Teachervictor manda , you need the generate
command before the word scaffold
:
bin/rails generate scaffold Post title:string
Make sure that Post
, your model name, is capitalized as well.
Be careful not to make any mistakes with these generate
commands! Check that the capitalization (Post
vs. post
) and pluralization (Post
vs. Posts
) of each word matches the tutorial. If you make a mistake on the command line, you may have hard-to-diagnose problems later.
Ishan Sharma
2,480 PointsIshan Sharma
2,480 Pointshow to do this ? how to change directory