From: janus Date: 2008-09-22T21:51:54+09:00 Subject: Re: system(" rake db:sample_data:hoop) > ENV['VERSION'] = 0 >Rake::Task["db:migrate"].invoke > > but I think that should work. > It worked, I only changed Fixnum 0 to string. Could you explain the difference between system("rake.....") and Rake::Task["......"] Janus On Sep 21, 2:18 pm, Michael Guterl wrote: > On Sun, Sep 21, 2008 at 8:17 AM, janus 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 didrakedb: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 thinkingRake::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 noRake::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 thatRakereads from in the db:migrate task.  I'm not sure of > the recommended method of setting environment variables, when using > theRake::Task[].invoke method. > > I cannot test at the moment: > > ENV['VERSION'] = 0Rake::Task["db:migrate"].invoke > > but I think that should work. > > HTH, > Michael Guterl