1

I'm having some difficulties with a new installation of Ruby on Rails. I want to use my application with MySQL.

Here's the problem: The server starts without a problem when I use the default database adapter (sqlite), but when I switch it to mysql2, the server won't start.

this is the error I get:

bin/rails:6: warning: already initialized constant APP_PATH ~/rails/testapi/bin/rails:6: warning: previous definition of APP_PATH was here

I have been searching for two hours now, and I've come to nothing that fixes the problem, but I read on a few forums that the startup script is executed twice.

I tried removing my app and re-creating it, but it didn't change anything.

Have anyone ever experienced this problem? And if so, did you find a solution?

Thank you

2 Answers2

1

Ok, I found a solution to my problem here: rails + MySQL on OSX: Library not loaded: libmysqlclient.18.dylib

It turns out that rake was not able to find the MySQL executable.

Thanks to Antony for his help.

Community
  • 1
  • 1
0

rake db:rollback You just rollback, and generate a new one. Otherwise you may check all the files..

Antony Mithun
  • 161
  • 1
  • 15
  • I tried to a rollback and re-configure the adapter, but it stays the same. I'll look a little more into rake to see if I'm missing something. – Jonathan Pellerin Apr 15 '14 at 13:29