SYMPTOMS
On some (mine, at least) Cygwin environments with Rails, user sees
the following error when running rake db:drop:all :
"This task only drops local databases. mp is on a remote host."
rake aborted!
Note that when using Cygwin, you have to enter 127.0.0.1 as your
host in database.yml.
CAUSE
This section of the databases.rake file seems to cause the problem:
if confighost? == 'localhost'
confighost?.blank?
drop_database(config)
else
p "This task only drops local databases. #{configdatabase?} is on a remote host."
end
Note that the conditional doesn't check if confighost? is
'localhost' *or* '127.0.0.1'. If you look at the part of
databases.rake that deals with *creating* databases, it has
conditional that deals with this:
if %w( 127.0.0.1 localhost ).include?(confighost?) confighost?.blank?
...
SOLUTION
I think the right thing is to use the same check for dropping
databases as for creating them.
Attachments
- databases.rake (14.7 kB) - added by antun on 04/19/08 06:15:05.
- Here's my fixed databases.rake file.
Change History
Download in other formats:
| |