How to install a Ruby .so extension into GEM/lib/SOME_DIR/ rather than GEM/lib

Iñaki Baz Castillo's Avatar

Iñaki Baz Castillo

28 Feb, 2011 02:55 PM

Hi, supposing a gemspec containing: do |spec| = "xxx-handler"
  spec.extensions = ["ext/xxx_parser/extconf.rb"]

when running "gem install xx-handler" the compiled extension is installed into GEMS_DIR/xxx-handler/lib/ directory.

Is it possible to tell the gemspec file to install the extension in a subdirectory within GEMS_DIR/xxx-handler/lib/ ?

Thanks a lot.

  1. 1 Posted by Luis Lavena on 28 Feb, 2011 03:12 PM

    Luis Lavena's Avatar


    Please read mkmf documentation about create_makefile

    See examples like sqlite3-ruby, mysql gem or others.

  2. Luis Lavena closed this discussion on 28 Feb, 2011 03:12 PM.

  3. Iñaki Baz Castillo re-opened this discussion on 28 Feb, 2011 03:25 PM

  4. 2 Posted by Iñaki Baz Casti... on 28 Feb, 2011 03:25 PM

    Iñaki Baz Castillo's Avatar

    Thanks, using "create_makefile(dir/name)" does the work.

  5. Nick Quaranto closed this discussion on 17 Mar, 2011 03:34 PM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac