Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

So after some problems with postgres on rails ala this Postgres rails doesn't recognize user, I uninstalled postgres and decided to try mysql for my rails app. I installed mysql successfully, and set up my database.yml as follows:

development:
  adapter: mysql2
  database: db_development
  user: root
  pool: 5
  password: ##
  timeout: 5000

test:
  adapter: mysql2
  database: db_test
  user: root
  pool: 5
  password: #
  timeout: 5000

production:
  adapter: mysql2
  database: db_production
  username: root
  pool: 5
  password: ##
  timeout: 5000

I also did rake db:create:all and rake db:migrate. However, I get the "We're sorry, but something went wrong" and when I check the logs, I get PG (postgres errors) like this:

PG::Error (FATAL:  role "ubuntu" does not exist
):
activerecord (3.2.13) lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'

Later, it references a PG database that was previously mentioned in database.yml and no longer exists:

PG::Error (FATAL:  database "db/production" does not exist
):
  activerecord (3.2.13) lib/active_record/connection_adapters/postgresql_adapter.rb:1216:in `initialize'

I have no idea what's going on. FWIW I'm using ruby 2.0, rails 3.2.13, nginx, and phusion passenger

share|improve this question
    
Did you restart nginx after changing the database.yml? –  jvperrin Oct 14 '13 at 5:37
    
Yeah, I restarted it. –  Alexander Moreno Oct 14 '13 at 5:41
    
What gems do you have? You need to have the mysql2 gem installed. –  jvperrin Oct 14 '13 at 5:56
    
Yup I have the mysql2 gem. It actually shows some mysql2 errors much later in the logs but I don't know why it even mentions PG. –  Alexander Moreno Oct 14 '13 at 14:50
    
That's really strange... I'm not sure if what would be going on if you have mysql2 errors and postgresql errors in the same file. –  jvperrin Oct 14 '13 at 15:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.