访问 MySQL 数据库时出现 RoR 段错误
我在 Solaris 10 服务器上运行 Ruby on Rails。 我今天刚刚重新安装了 Ruby,以便能够在我的 MySQL 系统上正常工作,这样我就可以添加我一直在开发的新应用程序。 我还更新了我的宝石和系统。 MySQL 是这个系统中唯一最近没有更新的东西,版本是 5.1.25。
当我运行 Mongrel 服务器时,系统可以正常工作几个负载,有时甚至更多。 在重新加载我的一个脚手架的索引几次后,或者添加一个新项目并加载其显示页面后,服务器报告分段错误并退出。 除了“分段错误(核心已转储)”之外,没有任何调试输出。 所有其他输出均显示正常。
我在我的服务器上创建了几个新应用程序,这些应用程序显示了相同的错误。 创建禁用数据库的应用程序不会出现此问题。
非常感谢任何帮助或建议!
更新:不幸的是,降级到 MySQL 5.0.45 并重新安装 mysql gem 并没有解决问题。 如果您有其他建议,请告诉我! 您可以在此处查看已安装软件及其版本的完整列表。
I'm running Ruby on Rails on a Solaris 10 server. I just reinstalled Ruby today to get things to work correctly with my MySQL system so I could add a new application I've been working on. I also updated my gems and the system. MySQL is the only thing in this system that hasn't been updated lately, that's at version 5.1.25.
When I run the Mongrel server the system will work okay for a couple loads, sometimes more. After reloading the index of one of my scaffolds a couple times, or adding a new item and loading its show page, the server reports a segmentation fault and exits. There is no debug output other than: "Segmentation Fault (core dumped)". All other output appears normal.
I've made a couple new applications on my server, and those show the same errors. Creating an application with the database disabled does not present this problem.
Any help or advice is greatly appreciated!
UPDATE: Unfortunately downgrading to MySQL 5.0.45 and reinstalling the mysql gem did not resolve the problem. If you have another suggestion, please let me know! You can see a complete list of the software installed and its versions here.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
您可以尝试安装最新的MySQL 5.0.x系列版本,目前为5.0 .83. 我从来没有能够让 ActiveRecord 与 MySQL 5.1.x 一起使用。 我还没有遇到段错误——就我而言,这是不同的错误——但我使用的是 CentOS。
我认为 5.0.x 是正确的选择。
You might try installing the latest 5.0.x series version of MySQL, currently 5.0.83. I've never been able to get ActiveRecord to work with MySQL 5.1.x. I haven't gotten segfaults -- in my case it was different errors -- but I am using CentOS.
I think 5.0.x is the way to go.
如果你检查database.yml,它位于第一行
MySQL。 推荐使用4.1和5.0版本。
我在XP中使用mysql 5.1遇到了类似的问题
if you check database.yml it's on the first line
MySQL. Versions 4.1 and 5.0 are recommended.
I ran into similar problems in XP with mysql 5.1
如果所有其他 anwsers 都不起作用,请回滚到仍然具有 mysql 连接器而不是 gem 的 Rails 2.1。 我在某些机器上看到 mysql gems 导致软件崩溃或无法正常工作......
If all the other anwsers are not working, roll back to rails 2.1 that still has the mysql connector instead of the gem. I saw on some machines that the mysql gems was causing the software to crash or not work properly...
这几乎肯定是 mysql gem 的本机 C 扩展的问题。 我会尝试以下几件事
This is almost certainly a problem with the native C extensions of the mysql gem. There are a couple things I would try