Sunday, May 25, 2008

Rails 2.0.2, restful authentication and db:create

Rails 2.0.2, restful authentication and rake db:create don't seem to play nice :(

rake db:create gives me

rake aborted!
Unknown database 'xxxx_devel'

(See full trace by running task with --trace)

Using rake --trace db:create pointed me to the following line in config/environment.rb:

config.active_record.observers = :user_observer

which I had added as part of configuration setup for restful_authentication.

I commented out this line and rake db:create ran fine. I will investigate more later, but this got me going for now.

1 comment:

macarthy said...

Try this

unless ( File.basename($0) == "rake" && ARGV.include?("db:migrate") )
config.active_record.observers = :user_observer
end

Justin