ruby-on-rails – rake因“虚拟计时器已过期”而失败

前端之家收集整理的这篇文章主要介绍了ruby-on-rails – rake因“虚拟计时器已过期”而失败前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
以下是我的环境:

> OS X 10.5
> Xcode 3.1.4
> rvm 0.1.38
>ruby1.8.9-p399(通过rvm)
> rails 2.3.8

当rake尝试运行我的测试时,我开始收到此错误

bash$rake
Virtual timer expired
bash$ # End of output!

并启用跟踪:

bash$rake --trace
** Invoke default (first_time)
** Invoke test (first_time)
** Execute test
** Invoke test:units (first_time)
** Invoke db:test:prepare (first_time)
** Invoke db:abort_if_pending_migrations (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute db:abort_if_pending_migrations
** Execute db:test:prepare
** Invoke db:test:load (first_time)
** Invoke db:test:purge (first_time)
** Invoke environment 
** Execute db:test:purge
** Execute db:test:load
** Invoke db:schema:load (first_time)
** Invoke environment 
** Execute db:schema:load
Virtual timer expired
bash$

解决方法

看起来ruby中有一个问题,rev23993 causes Virtual Timer Expired when forking,它反过来触发了MysqL gem中的错误.

实际的解决方法似乎是将MysqL gem从2.8.1降级
到版本2.7:

#environment.rb
config.gem 'MysqL',:version => '2.7'
原文链接:https://www.f2er.com/ruby/267568.html

猜你在找的Ruby相关文章