Using create_makefile('liboga/liboga') will compile liboga.so into path-to-gem/lib/liboga/ and therefore require_relative in oga.rb will fail. Therefore the right parameter for create_makefile is 'liboga' -> path-to-gem/lib/liboga.so