Friday, June 22, 2012

/path/to/.rvm/gems/ruby-1.9.3-p194@nameofgemset/gems/json-1.7.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.3.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02

Error message:
/path/to/.rvm/gems/ruby-1.9.3-p194@nameofgemset/gems/json-1.7.3/lib/json/ext/parser.bundle: [BUG] Segmentation fault ruby 1.8.7 (2010-04-19 patchlevel 253) [i686-darwin10.3.0], MBARI 0x6770, Ruby Enterprise Edition 2010.02


Problem:
In my case the JSON gem has a compiled extension that might've been corrupted or rendered incompatible. I'm guessing this because of the error message in the passenger log file (error message above). This is possible for other gems as well not just JSON, basically any gem that requires a compiled extension.


Fix:
There are multiple possible fixes.
1. `gem install json`
2. (the one that worked for me) rebuild all gems with `gem pristine --all`


Good luck and hope this helps.

Wednesday, June 20, 2012

how to load passenger from apache with rvm and unique gem sets

So i kept getting errors that said ruby couldn't find a specific gem. Looking at the stack trace it shows the version of ruby you are using and the gemset. Of course you can create a custom gemset for each app you are working on, but the problem is that passenger doesn't read your custom gemset without extra configuration. So here is where I found the fix (read first answer):
http://stackoverflow.com/questions/5680341/how-to-load-passenger-from-apache-with-rvm-and-unique-gem-sets