我试图安装祖先的宝石,但我有问题rake db:migrate
。
我下面的祖先GitHub的页面上的说明。 之后我做了rails g migration add_ancestry_to_message ancestry:string
我编辑迁移文件(以下railcast#262)为:
class AddAncestryToMessage < ActiveRecord::Migration
def self.up
add_column :messages, :ancestry, :string
add_index :messages, :ancestry
end
def self.down
remove_index :messages, :ancestry
remove_column :messages, :ancestry
end
end
当我再运行rake db:migrate
我收到以下错误:
== AddAncestryToMessage: migrating ===========================================
-- add_column(:messages, :ancestry, :string)
rake aborted!
An error has occurred, this and all later migrations canceled:
SQLite3::SQLException: no such table: Shipmgr: ALTER TABLE "Message" ADD "ancestry" varchar(255)
Tasks: TOP => db:migrate
我曾尝试在新创建的Rails应用程序,并在现有的Rails应用程序,但我仍然无法得到这个工作。 有没有人有任何关于此问题的意见?