2014-10-05 84 views
0

您好,感谢你在你的时间赛跑这个,在Heroku的回报率误差迁移DB

我是新来的回报率和i'm以下RUBY由迈克尔·哈特尔钢轨补习,我真是坚持了这个错误当我尝试到数据库迁移中的Heroku (我知道什么语法错误的手段(END),但我仍然解决不了)

heroku run rake db:migrate 

Running `rake db:migrate` attached to terminal... up, run.4787 
Migrating to CreateUsers (20141001220747) 
rake aborted! 
SyntaxError: /app/db/migrate/20141001220747_create_users.rb:10: syntax error, unexpected keyword_end, expecting end-of-input 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `block in require' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:214:in `load_dependency' 
/app/vendor/bundle/ruby/2.0.0/gems/activesupport-4.0.8/lib/active_support/dependencies.rb:229:in `require' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:722:in `load_migration' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:718:in `migration' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:712:in `disable_ddl_transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:1016:in `use_transaction?' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:1008:in `ddl_transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:962:in `execute_migration_in_transaction' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:924:in `block in migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:920:in `each' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:920:in `migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:768:in `up' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/migration.rb:746:in `migrate' 
/app/vendor/bundle/ruby/2.0.0/gems/activerecord-4.0.8/lib/active_record/railties/databases.rake:42:in `block (2 levels) in <top (required)>' 
Tasks: TOP => db:migrate 
(See full trace by running task with --trace) 

我已经做了我的研究,并想通了,问题是一个额外的或缺少的结束,但我已经尝试添加和删除结束...没有运气。奇怪的是,即使添加或删除ENDS,错误也完全相同。 下面是迁移文件

class CreateUsers < ActiveRecord::Migration 
    def change 
    create_table :users do |t| 
     t.string :name 
     t.string :email 
     t.timestamps 
    end 
    end 
end 

非常感谢,希望您能有所帮助。快乐编码

回答

1

发现问题!!!! 耶,所以很高兴的问题是,我不得不承诺的变化推他们到混帐,然后heroku,一旦我这样做,我可以运行数据库迁移没有问题...

顺便说一句我发布的代码顶部是正确的,但我第一次推它时,它有定义类的语法错误。