db:seed not loading models

后端 未结 3 443
轻奢々
轻奢々 2021-01-18 12:23

I\'m trying to seed my database with the standard db/seeds.rb method. This works fine on my development machine, but on my server, I get:

$ sudo         


        
3条回答
  •  天命终不由人
    2021-01-18 13:01

    I just ran across a good approach to this problem in this article. I'll summarize here so people can (hopefully) find it quicker.

    The idea is to turn off threadsafe in the production environment, first by editing config/environments/production.rb:

    config.threadsafe! unless ENV['THREADSAFE'] == 'off'
    

    You then set THREADSAFE=off when running rake tasks.

提交回复
热议问题