Rake stopped working - no error message

Hi all…

Background:

I’ve been ramping up on RoR recently and started to resume the photos
demo in the O’Reilly Book Ruby on Rails Up and Running. I had last
worked on this just before creating a migration script and I was
fairly comfortable at that point with understanding and creating
migrations and using rake. I took a divergence from this practice
project and even installed some other packages (macports, and some
other graphics stuff).

Now I’ve returned to this project and I’ve completed the latest .sql
changes and need to run rake migrate to go back to VERSION=0.

Problem:

I am running rake db:migrate just as I did in the past and I now just
get this:

mbp-osx:~/Sites/Rails/photos patakijv$ rake db:migrate
(in /Users/patakijv/Sites/Rails/photos)
mbp-osx:~/Sites/Rails/photos patakijv$

I get no error messages… but it doesn’t appear anything is
happening.

What have I forgotten already about rake or what am I doing wrong?

How can figure out what the problem is if I don’t have any error
messages?

Thanks,

John

To go back to version 0, you need to specify it at the command line:

$ rake db:migrate VERSION=0

then

$ rake db:migrate

WARNING: That will destroy any data you have at your database currently.

When you execute just “rake db:migrate”, and your database is already
at the latest schema version, no migrations are executed. You can look
at the current schema info at the corresponding table in the database.
For example, in MySQL:

mysql> select * from schema_info;
±--------+
| version |
±--------+
| 12 |
±--------+

If your latest migration file has the prefix 012, then the rake task
thinks that the database is up-to-date.

By the way, you can see what rake is doing at the background
activating the trace option:

$ rake --trace db:migrate

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke environment
** Execute db:schema:dump

Carlos P.

El 14/05/2008, a las 6:06, John
escribió:

Ah… ok - thanks!

I feel a little silly now… I could have sworn that I did that once
but obviously I mistyped something…
and I didn’t realize I would get no messages if there was nothing to
migrate.

Thanks again!

John