views:

136

answers:

4

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.

A: 

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.

Ethan
That didn't seem to work, as my edited question details. Do you have any other suggestions? I'd really appreciate them.
Dean Putney
A: 

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

Ed
I'm now running MySQL 5.0.45. It doesn't seem to have helped, as I still get segfaults. It seems to be tied to the number of times I load each page.
Dean Putney
A: 

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...

marcgg
+1  A: 

This is almost certainly a problem with the native C extensions of the mysql gem. There are a couple things I would try

  • Update your mysql-devel packages in your package manager and rebuild the mysql gem
  • Install a 5.0 version of mysql, and rebuild the mysql gem
  • Use the pure ruby mysql gem (http://www.tmtm.org/en/ruby/mysql/)
Michael Sofaer
Are there flags for setting directories for the MySQL system for the pure ruby gem? My system is a bit wonky, so I need to define the locations of the MySQL packages. I didn't see any details in the docs there.
Dean Putney
It doesn't need to find the packages, since it's pure Ruby, and has no compiled extensions. Try running setup.rb, and see if it can find the socket MySQL is running on.
Michael Sofaer
That does not seem to have helped. Thanks though. Do you have any other ideas?
Dean Putney
Does that mean you were able to use the pure ruby mysql package, and it didn't help? Maybe try uninstalling the mysql gem to make sure it's not being used?
Michael Sofaer
Yes. I installed the ruby gem you suggested and removed the standard mysql gem. The system loads the index page correctly, creates items in the database, and then segfaults as soon as I load the page a second time. Same behavior as with the standard gem.
Dean Putney