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は
NameError: uninitialized constant CreateCommments
をgetttingいますsqliteの3ののPG insteandでデータベースをやり直ししなければなりませんでした。私は一日中検索していますが、多くのソリューションを試してみましたが、無駄です。私はスペルのエラーを検索し、落として、データベースを再作成しました。私のdatabase.ymlは最新のもので、gemとgemlockはsqliteをきれいにしていますが、私には叫ぶのを止めることはできません。前もって感謝します。
どのバージョンのRailsを使用しますか?その移行の完全なファイル名とパスは何ですか? – spickermann
今私は2.2.1p85を使用しています古いプロジェクトを入れようとしていました – AAvelleyra