Search code examples
ruby-on-rails-4rubymine

Rubymine throws a **[BUG] Segmentation fault** when trying to run rspec test


I am trying to run my rspec tests from rubymine, but getting this error:

 ...[BUG] Segmentation fault at 0x00000000000438
ruby 2.1.2p95 (2014-05-08 revision 45877) [x86_64-darwin13.0]

-- Crash Report log information --------------------------------------------
   See Crash Report log file under the one of following:
     * ~/Library/Logs/CrashReporter
     * /Library/Logs/CrashReporter
     * ~/Library/Logs/DiagnosticReports
     * /Library/Logs/DiagnosticReports
   for more details.

-- Control frame information -----------------------------------------------
c:0051 p:-17566078017732 s:0152 e:000151 TOP    [FINISH]
c:0050 p:---- s:0150 e:000149 CFUNC  :require
c:0049 p:0022 s:0146 e:000145 BLOCK  /Users/Sunday/workspace/resilience/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.6.2/lib/nokogiri.rb:29
c:0048 p:0149 s:0143 e:000142 TOP    /Users/Sunday/workspace/resilience/vendor/bundle/ruby/2.1.0/gems/nokogiri-1.6.6.2/lib/nokogiri.rb:25 [FINISH]
c:0047 p:---- s:0141 e:000140 CFUNC  :require
c:0046 p:0064 s:0137 e:000136 TOP    /Users/Sunday/workspace/resilience/vendor/bundle/ruby/2.1.0/gems/loofah-2.0.2/lib/loofah.rb:3 [FINISH]
c:0045 p:---- s:0135 e:000134 CFUNC  :require...

I have checked on google and followed some stack-overflow answers on how to solve this, but non seems to be working for me.

I have also tried to upgrade the rubymine debugger with the following commands: gem install ruby-debug-base19x --pre and gem install ruby-debug-ide --pre.

the first threw an error: ruby_debug.c:861:98: error: no member named 'bp' in 'struct rb_control_frame_struct' if (debug_context->frames[debug_context->stack_size - 1].info.runtime.bp <= thread->cfp->bp), but the second was successful. Even then I still get the initial error on rubymine when I try to run my tests.

BTW: the tests run well from the terminal, and tests from other projects run well on rubymine. Only this perticular project is not running.

what can I do to make my rubymine run these rspec test from my projects. Thanks for any help.


Solution

  • I finally got it right. I have to go into Rubymine's preferences => Languages and Frameworks => Ruby SDK and Gems to update the version of ruby for the project from 2.1.2 to what is specified in the .ruby-version file for the project, which is 2.1.6.

    After doing this, everything worked fine as expected.