Rails 5, Rspec: Environment data not found in the schema

前端 未结 7 1129
南方客
南方客 2020-12-29 01:49

After upgrading a Rails app to Rails 5, running RSpec tests gives me the following error:

rails aborted!
ActiveRecord::NoEnvironmentInSchemaError: 

Environm         


        
7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-29 02:48

    fix for jenkins before you drop database you should execute db:environment:set with || true, so the command doesn't abort:

    bin/rails db:environment:set RAILS_ENV=test || true
    

提交回复
热议问题