I've met the problem like you.Here is my problem description.
try rake db:version,it returns 0.
try rake db:migrate,nothing happened and no table created,even there are migration files in db/migrate.
try rake db:migrate VERSION=YourAnyMigrationFileTimestamp, an exception raised,blames no such migration.
if your problem like me,may be you got or install a wrong rake task which change the default root when running migration task.
to check it,you need debug the third task,(http://stackoverflow.com/questions/2663912/rails-debugging-rails-tasks can tell you how to debug rake task).
debug line 548 in activerecord-3.0.1/lib/active_record/migration.rb,run Dir.pwd,if the
result is not your app root,there must be some other task change your default task dir.
The following is what i've debugged
(rdb:1) p self.class
ActiveRecord::Migrator
(rdb:1) n
/home/raykin/.rvm/gems/ruby-1.9.2-p0@r3local/gems/activerecord-
3.0.1/lib/active_record/migration.rb:550
files = Dir["#{@migrations_path}/[0-9]_.rb"]
(rdb:1) n
/home/raykin/.rvm/gems/ruby-1.9.2-p0@r3local/gems/activerecord-
3.0.1/lib/active_record/migration.rb:552
migrations = files.inject([]) do |klasses, file|
(rdb:1) p files
[]
(rdb:1) p @migrations_path
"db/migrate/"
(rdb:1) p Dir['db/migrate/[0-9]_.rb']
[]
(rdb:1) l
* output flushed *
(rdb:1) Dir.pwd
* Unknown command: "Dir.pwd". Try "help".
(rdb:1) p Dir.pwd
"/home/raykin/campus/:/code/campus/db/data_export"
see,the current dir has been changed,cause rails would load all task before running
migration(there seems a method to skip the all load),and some bad task(just i wrote it yesterday...) change the current dir.
This is exactly not a problem of Rails,but it is really a confused result for user.
hopefully can help you.