-Fatal- 分配内存失败 - Rails 3.1 和 Mysql2 Gem [英] -Fatal- failed to allocate memory - Rails 3.1 and Mysql2 Gem
问题描述
我在使用最新的mysql2" gem 和 Rails 3.1 时遇到了一个奇怪的问题,当我包含 gem 时,我可以从 IRB 正常运行 mysql,但是每当我尝试在控制台中保存到数据库时,都可以使用 rails,或者即使在服务器启动时加载页面,我也会[致命] 分配内存失败.
I'm having a strange problem with the latest 'mysql2' gem and Rails 3.1 I can run mysql fine from the IRB when I include the gem, but with rails whenever I attempt to save to the database in the console, or even load up the page when the server starts, i get [FATAL] Failure to Allocate Memory.
似乎没有任何可用的 mysql 日志,这是 Rails 显示的唯一错误.有趣的是,当我在 Rails 控制台中启动连接并运行计数查询时,例如User.count,它工作正常,但是当我尝试退出控制台时,它无限期地挂起.与我配对的所有人都使用相同的代码库和数据库结构,并且没有任何问题......
There don't seem to be any mysql logs available, and that is the only error Rails shows. Interestingly enough, when I do start a connection in the Rails console and just run a count query e.g. User.count, it works fine, but when I try to exit the console it hangs indefinitely. All the guy I'm pairing with is using the same codebase and database structure and gets no issues ...
其他人有这种问题吗?我昨天尝试卸载并重新安装自制软件和mysql,但它仍然发生.
Anyone else had this kind of issue? I tried uninstalling and reinstalling homebrew and mysql yesterday and it still happens.
推荐答案
我也有这个
[致命] 分配内存失败
[FATAL] failed to allocate memory
错误,修复方法是卸载我在 brew 公式中的 mysql-connector-c.
error and the fix was to uninstall the mysql-connector-c which I had in my brew formulas.
brew uninstall mysql-connector-c
这篇关于-Fatal- 分配内存失败 - Rails 3.1 和 Mysql2 Gem的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!