Ruby on rails 数据库迁移错误-无法在ruby on rails中迁移数据库

Ruby on rails 数据库迁移错误-无法在ruby on rails中迁移数据库,ruby-on-rails,ruby,sqlite,Ruby On Rails,Ruby,Sqlite,我使用sqlite3作为开发数据库。我使用这段代码来迁移db rake db:migrate 还尝试了这个railsdb:migrate 但是我犯了这个错误 *SyntaxError: /Users/kangkanlahkar/Desktop/Codes/Ruby/practice/db/migrate/20170721152949_create_users.rb:4: syntax error, unexpected '\n', expecting &. or :: or '[' o

我使用sqlite3作为开发数据库。我使用这段代码来迁移db

rake db:migrate
还尝试了这个
railsdb:migrate
但是我犯了这个错误

*SyntaxError: /Users/kangkanlahkar/Desktop/Codes/Ruby/practice/db/migrate/20170721152949_create_users.rb:4: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'
/Users/kangkanlahkar/Desktop/Codes/Ruby/practice/db/migrate/20170721152949_create_users.rb:5: syntax error, unexpected '\n', expecting &. or :: or '[' or '.'*
你知道怎么修吗。我正在使用mac

但是命令
railsdb:migrate:status
工作正常

20170721152949_create_users.rb文件的内容

class CreateUsers
您只需删除导致语法错误的
t.string
之后的额外逗号即可。请尝试以下操作:

class CreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table :users do |t|
      t.string :name
      t.string :email
      t.integer :phone
      t.timestamps
    end
  end
end
class CreateUsers
您只需删除导致语法错误的
t.string
之后的额外逗号即可。请尝试以下操作:

class CreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table :users do |t|
      t.string :name
      t.string :email
      t.integer :phone
      t.timestamps
    end
  end
end
class CreateUsers
语法错误,意外的“\n”,应为&。或::或“[”或“.”

必须删除
t.string

class CreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table :users do |t|
      t.string :name
      t.string :email
      t.integer :phone
      t.timestamps
    end
  end
end
class CreateUsers
语法错误,意外的“\n”,应为&.或::或“[”或“.”

必须删除
t.string

class CreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table :users do |t|
      t.string :name
      t.string :email
      t.integer :phone
      t.timestamps
    end
  end
end
class CreateUsers
删除
t.string
后的逗号:

class CreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table :users do |t|
      t.string :name
      t.string :email
      t.integer :phone
      t.timestamps
    end
  end
end
class CreateUsers
删除
t.string
后的逗号:

class CreateUsers < ActiveRecord::Migration[5.1]
  def change
    create_table :users do |t|
      t.string :name
      t.string :email
      t.integer :phone
      t.timestamps
    end
  end
end
class CreateUsers
此迁移文件db\migrate\20170721152949_create_users.rb中的问题,您可以上载内容吗?我已经添加了文件的内容。此迁移文件db\migrate\20170721152949_create_users.rb中的问题,您可以上载内容吗?我已经添加了文件的内容