On Sun, Sep 21, 2008 at 8:17 AM, janus <emekamicro / gmail.com> wrote:
> Things have starting moving in the right direction, however,
> Rake::Task['db:migrate VERSION=0'].invoke was aborted. What could have
> caused this? However, when I did rake db:migrate VERSION=0 on the
> console ,I got the expected result.
>

Once again, the actual error would be helpful.  Be sure to include
that with any other future problems.

However, it seems that you're thinking Rake::Task[] works like
system().  This is not the case, Rake::Task[] only looks up the
corresponding task with that name.  It is likely that there is no
Rake::Task defined with the name 'db:migrate VERSION=0'.

The VERSION=0 part is not a part of the task name, but an environment
variable that Rake reads from in the db:migrate task.  I'm not sure of
the recommended method of setting environment variables, when using
the Rake::Task[].invoke method.

I cannot test at the moment:

ENV['VERSION'] = 0
Rake::Task["db:migrate"].invoke

but I think that should work.

HTH,
Michael Guterl