class CreateComments < ActiveRecord::Migration
def change
create_table :comments do |t|
t.integer :link_id
t.text :body
t.references :user, index: true, foreign_key: true
t.timestamps null: false
end
add_index :comments, :link_id
end
end
我部署我的應用程序的Heroku,不得不當我遷移我的數據庫,我流汗這NameError:未初始化不斷CreateCommments Ruby on Rails的
NameError: uninitialized constant CreateCommments
重做SQLite中3的PG insteand數據庫我一整天都在搜索,並嘗試了很多解決方案,但無濟於事。我搜索了拼寫錯誤,刪除了,重新創建了數據庫。我的database.yml是最新的,寶石和gemlock是乾淨的sqlite,但它不會停止對我大喊大叫。先謝謝你。
您使用的是哪個版本的Rails?該遷移的完整文件名和路徑是什麼? – spickermann
現在我正在使用2.2.1p85我試圖把一箇舊項目上移 – AAvelleyra