rake db:test:load, undefined method `[]' for nil:NilClass

回眸只為那壹抹淺笑 提交于 2019-12-06 16:22:34

Add configurations for test env in your database.yml.

Also remember to use different database_name for your test db.

test:
  adapter: mysql2
  encoding: utf8
  database: c9_test
  username: <%=ENV['C9_USER']%>
  host: <%=ENV['IP']%> 

And then hit this command

RAILS_ENV=test rake db:setup

You probably want to run the command with a specific environment passed to it. So to speak:

bundle exec rake db:test:load RAILS_ENV="development"

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