Take the 2-minute tour ×

I have no root on the machine I'm working on, so I've had to install ruby in my home directory. Everything works fine, except that I am not able to compile any native ruby extensions because it cannot find ruby.h. I cannot work out for the life of me how to specify a particular include directory for ruby.h, I've tried setting environment variables for CFLAGS, CPPFLAGS and LDFLAGS with the relevant include directories and lib directories respectively.

Does anyone have any idea how to achieve this or any experience working with local installs of Ruby?

Thanks in advance, Ben

share|improve this question
add comment

1 Answer

I think exporting your include path should work

export C_INCLUDE_PATH=/path/to/directory/where/ruby.h/is/

However I am not sure entirely how you are attempting to build these extensions. I am assuming with Make.

share|improve this answer
I can't get as far as make as extconf.rb won't generate the makefile (because it can't find ruby.h), lemme try that. –  benofsky Jul 1 '10 at 23:34
Nope no luck with that :( –  benofsky Jul 1 '10 at 23:35
What library are you trying to build? –  Nathan Powell Jul 2 '10 at 0:26
Eventmachine, but it's the same with all native extensions. –  benofsky Jul 2 '10 at 7:38
add comment

Your Answer


