我收到以下错误消息,不知道如何解决它。有人可以帮忙吗?
NoMethodError:未定义方法“needs_migration?”为了
ActiveRecord::迁移器:类
这是 config.ru 代码:
require './config/environment'
if ActiveRecord::Migrator.needs_migration?
raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
end
use Rack::MethodOverride
use UsersController
use ArtworkController
run ApplicationController
将您的代码更改为
if ActiveRecord::Base.connection.migration_context.needs_migration?
raise 'Migrations are pending. Run `rake db:migrate` to resolve the issue.'
end
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)