Segmentation fault : Ruby 1.9.3-p125 and RVM
This problem is not something that is specific to the version of ruby that you are using. It just comes with RVM, at least that is what I have observed since I started using RVM to manage different ruby version on my MacBook.
Now, the reason behind this problem is the SSL or OPENSSL that the ruby library is pointing to and the one that is installed on your system are not same. There are certain libraries that require using ssl, e.g if you try to send mail, or try do image processing in rails using any gem like carrierwave or paperclip etc, this problem may arise.
Solution:
1. Install openssl package (if not already)
$ rvm pkg install openssl
2. Remove the already installed ruby version from RVM that is creating problem, in my case, it was 1.9.3-p125
$ rvm remove 1.9.3-p125
3. Re-install ruby version, 1.9.3-p125, specifying the openssl dir as well, so that ruby this time points to the correct openssl.
This should pretty muh resolve your problem of segmentation fault.
$ rvm install 1.9.3-p125 –with-openssl-dir=$rvm_path/usr

One quick comment the last command is actually
rvm install 1.9.3-p125 –with-openssl-dir=$rvm_path/usr
not
rvm install 1.9.3-p125 –with-openssl-dir=$rvm_path/usr
as it’s listed (notice the — on the with-openssl-dir flag)
Whoops, looks like word press is replacing the double dash with a single one – it’s a double dash before the flag.
Thanks for that! Much appreciated!