简体   繁体   中英

Rake showing connection error in Mac OS X Lion

I'm trying to set up a rails 2.2.2 application in Mac OS X Lion. while doing 'rake db:migrate', I get the following error:

rake aborted!
No connection to server

Tasks: TOP => db:migrate => environment
(See full trace by running task with --trace)

I've installed mysql gem with the following command:

env ARCHFLAGS="-arch x86_64" gem install mysql -v='2.8.1' -- --with-mysql-dir=/usr/local/mysql --with-mysql-lib=/usr/local/mysql/lib --with-mysql-include=/usr/local/mysql/include --with-mysql-config=/usr/local/mysql/bin/mysql_config

I'm able to connect to mysql server with mysql client with the same information in config/database.yml.

Please help me fix this.

Your configuration looks good, it maybe due to some other dependency that rake is failing. Perhaps you can see this better if you do a rake db:migrate --trace.

In the context of a rails application rake db:migrate runs all the gems included in the rails application. It maybe that the error you are seeing is due to some issue with some other gem. You can check this by going through the trace returned by rake and seeing what broke.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM