rake aborted! uninitialized constant Object::Country, why can't see model?

一世执手 提交于 2019-12-19 21:45:39

问题


I have rails 3.1, I am trying to populate data with seeds.rb I have a model Country which is migrated into a countries table

But it seems that rails can't see Country model from seeds.rb I get this error:

rake aborted!
uninitialized constant Object::Country

Tasks: TOP => db:seed

my seeds.rb file looks like this:

# encoding: UTF-8

Country.delete_all

my Country model:

class Country < ActiveRecord::Base
  has_many :students
  has_many :instructors

end

any idea please ?

EDIT

I am in development environment, with config.threadsafe!

来源:https://stackoverflow.com/questions/8628830/rake-aborted-uninitialized-constant-objectcountry-why-cant-see-model

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!