Bizarre mysql2 segmentation error on a Rails 3.2, RVM 1.9.2, FASTCGI setup

software development



I wanted to run my Rails 3.2.3 app on my shared hosting account, which entails not using Passenger because it requires ruby 1.9.2 to work. I followed the DH Wiki instructions on setting up FastCGI with Rails 3; works. I installed RVM with ruby 1.9.2 and set it to my ruby executable for my DH user account for my domain; done.

The app bundles fine, except I get this bizarre error when I run the dispatch.fcgi in my public dir:

‘/home/[my user account]/.rvm/gems/ruby-1.9.2-p290/gems/mysql2-0.3.11/lib/mysql2/ [BUG] Segmentation fault
ruby 1.8.7 (2010-08-16 patchlevel 302) [x86_64-linux]’

I researched this issue EVERYWHERE and the common recommendations are to update/reload RVM (did it, nothing), reinstall MYSQL gem or mysql gem (no dice), or using any number of mysql versions in my Gemfile. None of these made any difference.

There’s a lot that doesn’t add up here, but mostly the fact that the error points to ‘ruby 1.8.7’. I wonder if this has anything, specifically, to do with DH ruby executables or it’s just some generic gem error based on MYSQL support that defaults to ruby 1.8.7 for the version of MYSQL that DH uses.

I can’t imagine that NO ONE has yet tried to run rails 3.2.2 on their DH shared yet. Please help!




I’m sorry I can’t answer your question… because I have the same issues. This week I installed RVM with ruby 1.9.2 and Rails 3.2.3 on my DH shared hosting account with a FastCGI dispatch script (per the wiki).

I too noticed ruby 1.8.7 in the error messages, though I did not have the same messages. I’m still struggling with it.

I also tried limiting my $PATH to ~/.rvm. Bundler seems to run OK, but Rails can’t resolve some of the things it needs.

My “rvm requirements” output suggests I need to install “build-essentials” and some other basics. I had a feeling it just wasn’t going to work without help from system libraries.


Most likely your dispatch file is set to run the version of Ruby on the shared server and not the version of Ruby you have installed with RVM.

If you dispatch file reads

$ head dispatch.fcgi

You would just need to replace the top of your dispatch file with


Or wherever your ruby binary is of course.