ruby-oci8 & SELinux

LoadError: /opt/oracle/instantclient_10_2/ cannot restore segment prot after reloc: Permission denied - /usr/local/ruby192p0/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.0.3/lib/
from :29:in `require'
from :29:in `require'
from /usr/local/ruby192p0/lib/ruby/gems/1.9.1/gems/ruby-oci8-2.0.3/lib/oci8.rb:23:in `'
from :33:in `require'
from :33:in `rescue in require'
from :29:in `require'
from (irb):1
from /usr/local/ruby/bin/irb:12:in `'

/ cannot restore segment prot after

If you encounter an error like above, the problem very well could be the SELinux (Security Enhanced Linux) conf setting.   We ran into this issue trying to use ruby-oci8 in our rails application.  It was working on one CentOS VM we built, but not on another coworkers.  After painstakingly taking things apart, it turns out the difference between the two virtual machine instances was that the ‘getenforce’ command returned ‘Disabled’ on one and ‘Enforcing’ on another.

A quick ‘setenforce 0’ will enable you to test out if this fixes your issue.  However be warned that to disable it so that it doesn’t come back after restarting, you must modify the ‘/etc/selinux/config’ to disable it permanently.   GL!

FYI – Ruby 1.9.1p243 and passenger 2.2.x not compatible

I tweeted this about two months ago, and since then I’ve talked to at least two people who have hit this same issue. I’m hoping google will index this and help any pour soul out there who takes the time to build or install ruby 1.9.1p243 and try to make it work with passenger 2.2.x – DONT TRY. I’m currently running ruby 1.9.1p129 with passenger 2.2.x without issue. So here it is:

Wary soul – go back – or move foward, but p243 will only claim hours of your life!