Ruby Native Extension - Manual Compilation

173 Views Asked by At

I created new Ruby C Extension and hosted it in GitHub, and I install via Bundler (gem 'my_cool_gem', git: '..').

But when I run the application (rails s) I get an error -

cannot load such file -- my_cool_gem/my_cool_gem

My current solution, is to manually compile it:

$ cd $(bundle show my_cool_gem)
$ rm ext/my_cool_gem/*.o
$ rake compile

only then, my app works.

Any ideas?

1

There are 1 best solutions below

0
Alex Simenduev On BEST ANSWER

You probably misconfigured your extconf.rb.

Make sure you have create_makefile line to look like:

create_makefile(File.join(extension_name, extension_name))