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 Ruby on Rails 5 Basics Creating an App Our First Resource

bin/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
STAFF
Jay McGavren
Treehouse Teacher

Does 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.

how to do this ? how to change directory

Got everything working. Thanks!

bin/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
Jay McGavren
Treehouse Teacher

victor 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.