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:

Gem::Specification.new do |spec|
  spec.name = "xxx-handler"
  [...]
  spec.extensions = ["ext/xxx_parser/extconf.rb"]
end

when running "gem install xx-handler" the compiled extension xxx_parser.so 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. Support Staff 1 Posted by Luis Lavena on 28 Feb, 2011 03:12 PM

    Luis Lavena's Avatar

    Hello,

    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

Generic

? 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

Recent Discussions

23 Oct, 2014 05:37 PM
21 Oct, 2014 10:47 AM
18 Oct, 2014 08:39 PM
16 Oct, 2014 12:41 PM
06 Oct, 2014 02:30 PM