Skip to content

Using local gem directory in Gemfiles using "path"

emilsoman edited this page Oct 2, 2014 · 1 revision

As you may already know, bundler can install gems in local directories if you make use of the "path" option in Gemfiles. But the catch is that bundler doesn't take care of compiling the C extension and moving it to the LOAD_PATH. So what I do is :

  1. Compile the C extension manually which would create the rbkit_tracer.bundle in ext directory.
  2. Create a symlink at lib/rbkit_tracer.bundle that points to ext/rbkit_tracer.bundle.
  3. Use the path option in Gemfiles as usual.

This makes sure that whenever you build the C extension, the latest bundle is available in the lib directory as well.