[Rake-devel] How to pass arguments to Rake::Task['name'].invoke ?
Luis Lavena
luislavena at gmail.com
Tue Jan 13 08:43:40 EST 2009
On Tue, Jan 13, 2009 at 11:26 AM, Dominik Mayer
<dominik.mayer at beagile.de> wrote:
> thanks for your reply!
>
> sadly this only works for
>
> ENV['VERSION']
>
> but not for
>
> ENV['RAILS_ENV']
>
> so if i'm in development-environment, the following would not drop my
> test-db (unfortunately it would drop my development-db):
>
> ENV['RAILS_ENV'] = 'test'
> Rake::Task['db:drop'].invoke
>
> any other ideas on that?
>
Looks like your rails environment already initialized? your task is
depending on :environment?
You should try setting ENV['RAILS_ENV'] and also changing RAILS_ENV
constant (or at list check if it's defined).
--
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exupéry
More information about the Rake-devel
mailing list