Running rake db:create (or rake db:create:all) results in an error message such as, "db/development.sqlite3 already exists". The error message is always printed regardless of whether the database already existed or not.
This is due to the fact that the create_database method in railties/lib/tasks/database.rake wrongly assumes that the following two lines attempt a connection only:
ActiveRecord::Base.establish_connection(config)
ActiveRecord::Base.connection
In reality, the SQLite adapter will automatically create the database if it doesn't exist already and no errors are raised. Therefore the else clause of the begin/rescue statement is invoked every time, in turn printing the message mentioned above.
The attached patch fixes this.