The SitePoint Forums have moved.

You can now find them here.
This forum is now closed to new posts, but you can browse existing content.
You can find out more information about the move and how to open a new account (if necessary) here.
If you get stuck you can get support by emailing forums@sitepoint.com

If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

Table `stories already exists. Could not find table stories.

Argh, I am trying to follow along with SitePoint's well written ruby on rails tutorial for beginners . I'm on page nine and I made the table in the database (I have no idea where the database is located or how Rails is supposed to know that it is communicating with that database and not another one.) But when I attempt to make story an object in rails using the line

Code Ruby:

story = Story.new

I get this result:

Code :

ActiveRecord::StatementInvalid: Could not find table `stories`

And then a bunch of jargon following. I tried to screenshot it but I'm not allowed to post links yet and I can't copy/paste.

I'm kind of confused but I really appreciate your help. So I just realized that the program I was working with was just a .rb file located in a folder I called practice. I now realize that it should be located in a sub directory of "C:\cygwin\home\Owner\shovell\app". Which sub directory should it go in, controllers, models, helpers, or views? Also, what should it's name be, if it has to be something in specific? I changed the data in the yml file to say

I think the first place to start is for you to post your database.yml. Put it between &#91;code&#93; and &#91;/code&#93; and the formatting will be preserved in your posting. From the database.yml we will be able to see how your application is configured to connect to the database. Once we know that, we can give you more specific advice as to what to do next.

...I was working with was just a .rb file located in a folder I called practice. I now realize that it should be located in a sub directory of "C:\cygwin\home\Owner\shovell\app".

Also worth noting is that Rails application files will not work in isolation. They need to be used within the application. Your statement above seems to indicate that you are getting to the ruby console line directly (via irb?) rather than actually using the Rails console.

To test your application at the console level the best policy is to navigate to the root of your application in the Windows shell (DOS/Command window) and then use the following command to access the Rails console:

Code:

ruby script/console

That will get you to a ruby console but crucially will also load all the supporting systems needed for the application to run.

Looking at your earlier postings, that command needs to be run at "C:\cygwin\home\Owner\shovell\app". So: