2014-10-05 86 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,一旦我這樣做,我可以運行數據庫遷移沒有問題...

順便說一句我發佈的代碼頂部是正確的,但我第一次推它時,它有定義類的語法錯誤。