class User < ActiveRecord::Base
has_many :comments
end
class Comment < ActiveRecord::Base
belongs_to :user
end
然後我運行:rake db:migrate。我的評論表中沒有「user_id」字段/列。我也嘗試過:rake db:drop,rake db:creat
按照截屏http://railscasts.com/episodes/342-migrating-to-postgresql?autoplay=true 高達的步驟「耙分貝:創建:所有」,並得到錯誤: could not connect to server: No such file or directory Is the server running locally and accepting