Segmentation fault with Ruby 1.8.7
You could try rebuilding some or all of your gems. It may be related to your shared libraries and .bundle
files.
JSON has a compiled extension that might've been corrupted or rendered incompatible.
Segmentation fault - Ruby 1.8.7 and Rails 3.1.3
A note from guides.rubyonrails.org says:
I've had very good luck with 1.9.2 and rvm makes it easy to switch between multiple versions of ruby. Would you be able to try this?Note that Ruby 1.8.7 p248 and p249 have marshaling bugs that crash Rails 3.0. Ruby Enterprise Edition have these fixed since release 1.8.7-2010.02 though. On the 1.9 front, Ruby 1.9.1 is not usable because it outright segfaults on Rails 3.0, so if you want to use Rails 3 with 1.9.x jump on 1.9.2 for smooth sailing.
gem install raises segmentation fault with ruby 1.8.7, rbenv and no other local gems
Using older version of gcc helped me. Here're the steps I took to resolve the issue in my case:
Add repositories containing older versions of gcc for Ubuntu 16.04 and install it:
sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt install gcc-4.4
Build project using older gcc:rbenv uninstall 1.8.7-p352
CC=/usr/bin/gcc-4.4 rbenv install 1.8.7-p352
CC=/usr/bin/gcc-4.4 rbenv local 1.8.7-p352
Intentionally cause a segfault under Ruby 1.8.7
You might check out segfault4r (it was last updated in 2007). You have to download and install the gem manually, as it's not available through RubyGems.
Segmentation fault when installing ree-1.8.7-2011.03
I got it working by doing CC=/usr/bin/gcc-4.2 rbenv install ree-1.8.7-2011.03
. I think the problem is that I have an old version of ruby-build
.
Got the idea from http://www.andygoundry.com/2012/02/24/helping-out-rvm-on-mac/
Why is Ruby throwing a Segmentation fault on only my system, and only in this Rails application?
Ok, I've fixed this on my machine. I'm not sure exactly why, but downgrading the ruby-debug gem to version 0.10.0 solves the problem for me.
The specific fix is running the following commands:
sudo gem uninstall ruby-debug
sudo gem install ruby-debug --version 0.10.0
Related Topics
How to Resize Image Only If Width Exceeds with Graphics/Image Magick
Running "Bundle Install" Fails and Asks Me to Run "Bundle Install"
Modifying Text Inside HTML Nodes - Nokogiri
Server Sent Events and Rails Streaming
Hw Impossibility: "Create a Rock Paper Scissors Program in Ruby Without Using Conditionals"
How to Set in a Middleware a Variable Accessible in All My Application
Escaping Strings for Ruby Sqlite Insert
How to Use C# Style Enumerations in Ruby
Why Can't The Mail Block See My Variable
How to Remove a Url's Trailing Slash in a Rails App? (In a Seo View)
What Is The Ruby Equivalent to This Curl Request
Puzzled Over Palindromic Product Problem
Why Are Global Methods Allowed to Be Defined Outside of a Class in Ruby
How to Automatically Escape HTML Content Using Jekyll and Markdown
Waiting for Ruby Child Pid to Exit
Why Am I Getting "Unable to Autoload Constant" with Rails and Grape