我已经看到了这个问题的一些答案,但似乎没有一个对我有用。不小心跑了heroku run rake db:seed
两次。所以在我的数据库中有双重日期。所以我想删除表,重新迁移并再次运行种子(这次一次;))到目前为止我看到的解决方案告诉我运行:heroku pg:reset SHARED_DATABASE
或heroku pg:reset SHARED_DATABASE --confirm <myAppName>
。两者都不起作用。我得到的错误是这样的:
heroku pg:reset SHARED_DATABASE
/usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/pg_resolver.rb:125:in `parse_config': undefined method `each' for nil:NilClass (NoMethodError)
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/pg_resolver.rb:116:in `parse_config'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/pg_resolver.rb:79:in `initialize'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/pg_resolver.rb:34:in `new'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/pg_resolver.rb:34:in `resolve_db'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command/pg.rb:70:in `reset'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/lib/heroku/command.rb:114:in `run'
from /usr/local/lib/ruby/gems/1.9.1/gems/heroku-2.8.0/bin/heroku:14:in `<top (required)>'
from /usr/local/bin/heroku:19:in `load'
from /usr/local/bin/heroku:19:in `<main>'
我想要做的就是能够删除表,然后用我的种子数据重新填充它。任何帮助将不胜感激。