Content

SSL! Abort Trap! Egad!

6 January 2010 // Filed under rvm

This recently happened to me:

$ rake db:migrate
/Users/jsharpe/.rvm/ree-1.8.7-2009.10/lib/ruby/1.8/openssl/ssl.rb:31: [BUG] Bus Error
ruby 1.8.7 (2009-06-12 patchlevel 174) [i686-darwin9.8.0], MBARI 0x8770, Ruby Enterprise Edition 2009.10

Abort trap

I’m really not sure who the culprit is here. I don’t think it’s REE since it also happens with 1.8.7. So is it 1.8.7? Is it RVM? Openssl? Or is it me? Whatever the case this took me a LONG time to figure out – I hope this post saves many thousands of people countless wasted hours.

Add this to ~/.bash_profile

export RUBYOPT="-ropenssl"

2010-01-06  ::  admin

  • Browse by category: rvm -

Talkback x 4

  1. Wayne E. Seguin
    6 January 2010 @ 11:48 am

    As a note we found out later that these segfault issues most often occur when the installed ruby’s architecture does not match the installed library’s. Happens with msql vs ruby, openssl vs ruby, etc…

    The ruby’s architecture is shown in rvm list. To find out the libraries architecture use the file command. Something like ‘file $(which mysql)’.

    ~Wayne

  2. Luke Francl
    5 February 2010 @ 4:41 pm

    Thanks for this post.

    I’ve been going through the Ruby upgrade treadmill today, trying to get onto 1.8.7. I initially upgraded to 1.8.7-p249 using MacPorts but I was getting a lot of bus errors, so I tried RVM. All was well until I tried to migrate my database, when I got the error above.

    I have openssl installed from MacPorts in /opt/local/bin/openssl and my architecture for that (i386) matches the one from rvm’s Ruby.

    However, the system openssl IS a universal binary:

    file /usr/bin/openssl
    /usr/bin/openssl: Mach-O universal binary with 2 architectures
    /usr/bin/openssl (for architecture ppc7400): Mach-O executable ppc
    /usr/bin/openssl (for architecture i386): Mach-O executable i386

    I think that RVM’s using that one. Your tip to do export RUBYOPT=”-ropenssl” fixes the problem.

    Another thing I found which fixed the problem is to specify the openssl you want to use when you compile.

    Here’s a post about how to do that. The command I used was:
    rvm install ruby-1.8.7-p174 –configure –with-openssl-dir=/opt/local

  3. adam french
    2 March 2010 @ 12:37 pm

    just to make record of things, this a known issue and has been reported to ruby-lang at http://redmine.ruby-lang.org/issues/show/405

    No real resolution, but Wayne’s right, usually this means that things need to be recompiled so that they’re all using the same underlying libraries.

    Other places to checkout: http://blog.lostincode.net/archives/2010/1/10/rvm_macports_hell/ is pretty good for those of us using rvm, http://www.timmedina.net/post/319568080/openssl-eventmachine-and-the-ruby-1-8-7-and-ree also.

  4. Nerses Ohanyan
    6 July 2011 @ 9:19 pm

    THANK YOU

Share your thoughts







Tags you can use (optional):
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>