segmentation fault from mysql_adapter.rb

Hello, I'm a rails newbie.

I wrote a simple application to navigate between 2 pages. This is my controller file

I'm getting this error message as well every morning when I'm back at work. I suppose monit could be of help here if I wasn't running in a Windows environment.

/Nicklas

Divya Mohan wrote:

Solved in any way!? I got the same problem..

Do you guys think that is a webserver problem? I mean switching from webrick to something else .. would I solve it?

adedip wrote:

Do you guys think that is a webserver problem? I mean switching from webrick to something else .. would I solve it?

On Apr 17, 10:00�am, Divya Mohan <rails-mailing-l...@andreas-s.net>

I am using Mongrel, so switching to that won't help. This is totaly driving me crazy.

Im having the same problem too, im getting it on that tutorial for creating your own blog, when I try and submit the form the ruby server crashes and I get the same error.

MYSQL Problem?

Divya Mohan wrote:

c:/ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/ lib/ active_record/ connection_adapters/ mysql_adapter.rb:202: [BUG] Segmentation fault ruby 1.8.6 (2007-09-24) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual way.

Please contact the application's support team for more information.

>

I am getting this same problem. I am getting it after setting up a new dev environment on a windows machine. I first saw it in RubyMine (IDE), when I went to the Tools->Rake Tasks->db->create->all command. I got this as the output:

C:\Ruby\bin\ruby.exe -e STDOUT.sync=true;STDERR.sync=true;load($0=ARGV.shift) C:\Ruby\bin/rake db:create:all (in H:/projects/DMS) C:/Ruby/lib/ruby/gems/1.8/gems/activerecord-2.3.2/lib/active_record/connection_adapters/mysql_adapter.rb:202: [BUG] Segmentation fault ruby 1.8.6 (2008-08-11) [i386-mswin32]

This application has requested the Runtime to terminate it in an unusual way. Please contact the application's support team for more information.

Process finished with exit code 3

What version of MySQL is everybody (that is having this problem) running?

I tried upgrading to 5.1 a while back and couldn't get Rails (ActiveRecord) to even work with it. I downgraded back to 5.0.x and everything worked fine again. I haven't tried going to 5.1 again.

E. Litwin wrote:

What version of MySQL is everybody (that is having this problem) running?

I tried upgrading to 5.1 a while back and couldn't get Rails (ActiveRecord) to even work with it. I downgraded back to 5.0.x and everything worked fine again. I haven't tried going to 5.1 again.

On May 4, 9:16�am, "Gregg H." <rails-mailing-l...@andreas-s.net>

I am running the latest 5.1 downloaded from http://dev.mysql.com/downloads/mysql/5.1.html#downloads

The strange thing is using the rake task for drop all works. And just as another sidenote, the create all task that seg faults for me does actually make the databases. I just dont know where it dies.

Gregg H. wrote:

I am also getting this, which I believe is related to the same problem:

== InitialStructureAndData: migrating

-- create_table("areas", {:force=>true}) rake aborted! An error has occurred, all later migrations canceled:

undefined method `each' for #<Mysql:0x4007ff4>

(See full trace by running task with --trace)

Fixed the problem. This solves both of my errors:

http://forums.aptana.com/viewtopic.php?f=20&t=7563&p=27407&hilit=libmysql.dll#p27407

The help at the aptana site fixed both my strange problems. Thanks so much. I was looking into changing to Mongrel/Apache to fix them.

One problem was when doing a find method on an ActiveRecord , ie Contact.find(1), it would get a seg fault . Contact.save would work fine and everything was getting to the MySQL db when I used ruby console. I'm working my way through the Ruby on Rails Bible by Timothy Fisher and it was very frustrating when simple examples did not work but enough worked that I didn't suspect my installation.

The solution from the aptera site was to install a MySQL 5.0 dll ( libmsql.dll )in place of the 5.1 one. When I looked in the ruby/bin directory it wasn't even there. Copying that file over (and restarting webrick, MySQL server & console) did the trick. I thought I had installed the mysql gem but I'm new to RoR so I certainly could have messed up somewhere. It also fixed my strange problem where trying to view pages would crash Webrick.

I am using MySQL 5.0 but I do have 5.1 installed.

Divya Mohan wrote:

Not yet solved. :frowning:

I had a simular problem (i am also newbie) for me it was solved by adding "host: localhost" in the config/database.yml file

Hope it can help some others to..

grtz, patrick