In an attempt to solve a NoMethodError I was having, I read somewhere that running rake db:reset
may help fix the problem. I am new to Rails and made the mistake of doing this without knowing exactly what this would do. When I ran it, it successfully dropped my development database (PosgreSQL), but then it hit a fatal error with the following message:
Dropped database 'development'
FATAL: Peer authentication failed for user "postgres"
Couldn't drop database 'test'
rake aborted!
PG::ConnectionBad: FATAL: Peer authentication failed for user "postgres"
Tasks: TOP => db:drop:_unsafe
I tried manually dropping the test database and rerunning rake db:reset
, however the same error occurred. So I lost the data I had in my development database and am stuck with nothing but an empty production database.
I realize that this can probably be fixed by editing the pg_hba.conf
file, but my app is running on my school's high performance cluster (Linux VM) and I don't have write access for that file. What I don't understand is why it was able to drop my development database, but not the rest.
I still have my seeds.rb
and schema.rb
files, so would it be possible to rebuild my databases without messing things up further? Or is there some way for me to fix the problem directly affecting the reset command?