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

Generate a rails application

So i'm stuck on this one.

I started using cloud9, but the text editor on that is meh so i said, sure, lets see if i can do this locally.

I cloned the project using git and now i'm trying to create the db, but its not working and the internet is not helping.

when i try db:create:all as mentioned at around 5:45 of http://teamtreehouse.com/library/programming/build-a-simple-ruby-on-rails-application/frontend-development/cloning-the-project cmd throws this error:

C:\Sites\treebook>rake db:create:all rake aborted! No such file or directory - C:/Sites/treebook/config/database.yml

Tasks: TOP => db:create:all => db:load_config (See full trace by running task with --trace)

I'm very perplexed, becuase I thought that was the point. Of course there is no DB, i'm asking you to make it?

any thoughts? I have a DB on cloud 9 but i'm not sure if i can just copy that over....

6 Answers

William,

Did you use Railsinstaller for Windows to install Rails, and all the dependencies? You might not have a DB on your local machine. Therefore it cannot create a DB if you do not have one on your local machine.

@Jesse - +1 Good call about installing rails

@william -

If you haven't installed rails yet, you can find out how to install Ruby on Rails on Windows at http://railsinstaller.org/

What happens when you type in rails --version into your command prompt.

Thanks! I did use railsinstaller.org (I followed the instructions at http://teamtreehouse.com/library/programming/build-a-simple-ruby-on-rails-application/getting-started-with-rails/installing-rails-windows ) . When i type "rails --version" it says Rails 3.2.12

However, I can't do any of the rails "stuff" mentioned in the videos unless i use the "Command Prompt with Ruby and Rails" link provided in start menu shortcut. Then everything seems to work like normal...except db:create:all.

I've been able to push forward using the cloud9 IDE (turns out you can set the syntax for the language and it makes a better editor) but I still would like to know how to make it work on my local computer.

Jason Seifer
STAFF
Jason Seifer
Treehouse Guest Teacher

Hi William, It's supposed to be an either/or thing with the lessons. When you generate the rails project, the config/database.yml file is ignored by git by default. Try copying that file to your Windows rails project and running the commands again.

OK, well that worked! Copied it over then did the create and migrate and seems to be working fine! Yay!

Thanks!

PS double thanks for the awesome course! I'm loving it!!!!