1

I'm learning rails with "agile web development with rails (3rd edition)" and I've gotten to the point where I'm supposed to make the depot app.

I have created the depot app, and I've added the script/generate files. I've raked the db. For some reason, no tables where created in the migration and upon running this command:

depot> sqlite3 db/development.sqlite3 "select version from schema_migrations"

I get nothing. Then when running localhost in my browser, instead of getting what I'm supposed to, I get the standard welcome to rails page.

Any advice?

Resolved:

It's always the simple things. Had to direct to localhost:3000/products instead of just to localhost:3000 - wasn't aware of this. Thanks!

1
  • Do you have the correct migration files in db/migrations/*.rb? Did you run rake db:migrate? Commented Feb 21, 2011 at 9:33

2 Answers 2

1

There is a number of possibilities here, firstly, judging by the fact you can see the standard "Welcome to Rails" page you haven't deleted public/index.html - you should do this so that Rails can route to the root /

Secondly, if your migrations are running correctly you should have a schema.rb file in ./db with the instructions for each table, if not then something is failing there.

I have not read the 'Agile web development with Rails" book but I am assuming it was written before the release of Rails 3, which means your app does not use Bundler for gem dependency management so it might be worth checking that sqlite3 gem is installed. You can check this with gem list sqlite if you don't see something like "sqlite3-ruby (1.3.2)" then you need to install it.

Lastly, check the log files in ./log/

Sign up to request clarification or add additional context in comments.

2 Comments

Hi. Deleting index.html gives the following error: No route matches "/" with {:method=>:get} Also, there is indeed a schema.rb file. All required gems are present.
That is exactly what you want, it means the request is now being routed to Rails instead of the index.html file, you probably have a bit more to go in the book before you hook up the routes which is why you're getting that error.
0

Well I guess you've created multiple migrations by now so try typing rake db:migrate at the command line and let use know what it says?

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.