2014-03-06 132 views
0

当试图数据库迁移到Heroku的我得到一个错误:Heroku的运行耙分贝:迁移错误`块method_missing的”

在我的移民文件,一个我曾经有似乎是一个错字一条线“ RU“,所以我只是删除它认为这是错误的根源。但事实并非如此。

class DeviseCreateUsers < ActiveRecord::Migration 
    t.string :first_name 
    t.string :last_name 
    t.string :profile_name 
    rU //This is the line I removed, but still get the same error message. 




== DeviseCreateUsers: migrating ============================================== 
-- create_table(:users) 
-- rU() 
rake aborted! 
An error has occurred, this and all later migrations canceled: 

undefined local variable or method `rU' for  <DeviseCreateUsers:0x007fa6ef156fd8>/app/vendor/bundle/ruby/2.0.0/gems/activerecord- 3.2.11/lib/active_record/migration.rb:465:in `block in method_missing' 
+0

它肯定看起来像行如果你仍然有这个错误,仍然存在。确保git添加并提交更改并重新部署到heroku并再次迁移。 – DiegoSalazar

+0

我刚刚检查过,它不在本地或git上。我已经把之前改变过的Github推给了Github。 – Lut

+0

你推到github?不是heroku? – DiegoSalazar

回答

0

它看起来像语法有点关闭。

如果你想只是一些列添加到现有的“用户”表:

add_column :users, :first_name, :string 
add_column :users, :last_name, :string 
add_column :users, :profile_name, :string 

如果您要创建表“用户”:

create_table "users", :force => true do |t| 
    t.string "first_name" 
    t.string "last_name" 
    t.string "profile_name" 
end