简体   繁体   中英

Rails DB rake tasks run but never exit

When I run any of the rake db tasks that Rails provides, they run successfully but never exit. I have to CTRL+C to quit the task. I've tested running it for over 8 hours and the problem persists.

Here's the output if I run rake db:migrate --trace :

** Invoke db:migrate (first_time)
** Invoke environment (first_time)
** Execute environment
** Invoke db:load_config (first_time)
** Invoke rails_env (first_time)
** Execute rails_env
** Execute db:load_config
** Execute db:migrate
** Invoke db:schema:dump (first_time)
** Invoke db:load_config 
** Execute db:schema:dump
_

Like I said, everything runs as expected, but it hangs after db:schema:dump .

I'm using the following:

  • Mac OS X 10.7.1 (Lion)
  • Ruby 1.9.2p290
  • Rails 3.1.0
  • MySQL 5.5.14
  • mysql2 gem 0.3.7

I'll also note that this is a base Rails app with no gems/code added. I can replicate with rails new testapp -d mysql then rake db:create or bundle exec rake db:create .

Has anyone run into this problem or know what I can do to further troubleshoot?

I fixed the problem.

First, I tried uninstalling the version of MySQL that was installed using the official binary then reinstalling using Homebrew. That did nothing.

I then ran brew update, restarted MySQL, and tried again. Eureka! It worked.

The culprit seems to have been a bug in an older version of one of the following:

libiconv
glib
gtk+

Those were the only formulas that were updated.

同样的事情也发生在我身上,但不要担心,我尝试了捆绑更新后,我从来没有遇到过这个问题。

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