Alfonso Giron Alfonso Giron - 2 months ago 61
Ruby Question

Rails 5 Bug (Segmentation fault)

Getting an error in the terminal running any rails command, for example 'rails test', after I modify a file in my project such as the model file 'users.rb' or the controller file 'users_controller.rb'. The bug is 'fixed' if I run 'spring stop' to restart the spring server. But it comes up every time I modify a file. Here is the initial message of the error/bug:

[sample_app (modeling-users)]$ time rails test
Running via Spring preloader in process 43345
/Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/activerecord- [BUG] Segmentation fault at 0x00000000000110
ruby 2.3.1p112 (2016-04-26 revision 54768) [x86_64-darwin15]

The error goes on for thousands of lines. Here is a small piece of the beginning of it:

-- Control frame information -----------------------------------------------
c:0072 p:---- s:0285 e:000284 CFUNC :initialize
c:0071 p:---- s:0283 e:000282 CFUNC :new
c:0070 p:0183 s:0278 e:000277 METHOD /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/activerecord-
c:0069 p:0028 s:0271 e:000270 METHOD /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/activerecord-
c:0068 p:0027 s:0268 e:000267 METHOD /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/activerecord-

And here is the last few lines:

1696 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/activesupport-
1697 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/railties-
1698 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/railties-
1699 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/railties-
1700 /Users/AlfonsoGiron/.rvm/rubies/ruby-2.3.1/lib/ruby/2.3.0/x86_64-darwin15/io/console.bundle
1701 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/thor-0.19.1/lib/thor/shell/basic.rb
1702 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/railties-
1703 /Users/AlfonsoGiron/.rvm/gems/ruby-2.3.1@global/gems/activesupport-
You may have encountered a bug in the Ruby interpreter or extension libraries.
Bug reports are welcome.
For details:

Basically every line is referring to '.rvm/gems/' etc. Clearly it's a rvm/gems issue? I've run 'bundle update' and reinstalled my gems to no avail. If anything, suggestions on the cleanest way to uninstall/reinstall Ruby/Rails? Thinking that may be a solution but would want to do it properly. Thanks.


It looks like a defect with the sqlite3 gem.. See bug report here: and

It does not appear there is a fix yet.. I'm having this issue as well, initially I was able to run brew update and then bundle update in a new terminal window which allowed me to call .connection on my models and get the console access again.. today this is still working but a very labourious process.