我跟隨Lynda ruby on rails教程。我被要求輸入「rake db:migrate」。但是,這是我收到的錯誤。rake db:migrate給我耙中止錯誤
lexi87$ rake db:migrate
rake aborted!
/Users/lexi87/Sites/simple_cms/db/migrate/20130107145627_create_users.rb:14: syntax error, unexpected $end, expecting keyword_end
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `block in require'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:236:in `load_dependency'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activesupport-3.2.9/lib/active_support/dependencies.rb:251:in `require'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:537:in `load_migration'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:533:in `migration'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:528:in `migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:720:in `block (2 levels) in migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:777:in `call'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:777:in `ddl_transaction'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:719:in `block in migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:700:in `each'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:700:in `migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:570:in `up'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/migration.rb:551:in `migrate'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/gems/activerecord-3.2.9/lib/active_record/railties/databases.rake:179:in `block (2 levels) in <top (required)>'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `eval'
/Users/lexi87/.rvm/gems/ruby-1.9.2-p320/bin/ruby_noexec_wrapper:14:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
我在我應該是,這是「sites/simple_cms」目錄。我安裝了rake,並運行了「gem install bundle」和「bundle install」。我已經在目錄中完成了這個,然後在「網站目錄」甚至主目錄中完成了。沒有什麼區別。
顯示文件DB的內容/遷移/ 20130107145627_create_users.rb –
類調用createUsers <的ActiveRecord ::遷移 高清self.up CREATE_TABLE:用戶做| T | t.string「first_name」,:limit => 25 t.string「last_name」,:limit => 50 t.string「email」,:default =>「」,:null => false t.string 「密碼」,:限=> 40個 t.timestamps 結束 結束 高清self.down drop_table:用戶 結束 –
找到答案,需要額外的「結束」 –