Rake problems

Hello, I’m trying to make my db, but when I put the code, it just don’t
do nothing…

felipe@Felipe:~/rails_projects/mailler$ rake db:migrate
felipe@Felipe:~/rails_projects/mailler$

what can be ?

Thank you.

Try executing:

bundle exec rake db:create
then
bundle exec rake db:migrate

On Thu, Feb 9, 2012 at 10:40 PM, Felipe Pieretti U. <

felipe@Felipe:~/rails_projects/mailler$ bundle exec rake db:create
mailler_development already exists
rake aborted!
Mysql::Error: Access denied for user ‘mailler’@‘localhost’ to database
‘mailler_test’: CREATE DATABASE mailler_test DEFAULT CHARACTER SET
utf8 COLLATE utf8_unicode_ci

Tasks: TOP => db:create
(See full trace by running task with --trace)
felipe@Felipe:~/rails_projects/mailler$ bundle exec rake db:migrate
felipe@Felipe:~/rails_projects/mailler$

thank you

On Fri, Feb 10, 2012 at 1:56 AM, Felipe Pieretti U. <
[email protected]> wrote:

felipe@Felipe:~/rails_projects/mailler$ bundle exec rake db:create
mailler_development already exists

So, your db exists and is reachable.

rake aborted!
Mysql::Error: Access denied for user ‘mailler’@‘localhost’ to database
‘mailler_test’: CREATE DATABASE mailler_test DEFAULT CHARACTER SET
utf8 COLLATE utf8_unicode_ci

Tasks: TOP => db:create
(See full trace by running task with --trace)

Don’t worry about this yet (you have not configured
the database.yml “test” section yest, you can do that later).

felipe@Felipe:~/rails_projects/mailler$ bundle exec rake db:migrate

So, this probably means that all required migrations have been run.
It only runs new migrations that are not yet in the database.

To see “something” moving … you could do something like this:

$ bundle exec rails generate model Foo name:string # generates a new
model
with it’s migration
invoke active_record
create db/migrate/20120210082759_create_foos.rb
create app/models/foo.rb
invoke rspec
create spec/models/foo_spec.rb
invoke factory_girl
create spec/factories/foos.rb

$ bundle exec rake db:migrate # now there is 1 new migration that needs
to
run
== CreateFoos: migrating

– create_table(:foos)
NOTICE: CREATE TABLE will create implicit sequence “foos_id_seq” for
serial column “foos.id”
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index
“foos_pkey”
for table “foos”
→ 0.0299s
== CreateFoos: migrated (0.0300s)

$ bundle exec rake db:rollback # rolling that back if yoiu don’t need
it
== CreateFoos: reverting

– drop_table(“foos”)
→ 0.0019s
== CreateFoos: reverted (0.0020s)

$ bundle exec rails destroy model Foo name:string # removing that Foo
test
model from the code also
invoke active_record
remove db/migrate/20120210082759_create_foos.rb
remove app/models/foo.rb
invoke rspec
remove spec/models/foo_spec.rb
invoke factory_girl
remove spec/factories/foos.rb

HTH,

Peter


*** Available for a new project ***

Peter V.
http://twitter.com/peter_v
http://rails.vandenabeele.com
http://coderwall.com/peter_v