Gemspec: How to install a Ruby extension into GEM/lib/SOME_DIR/ rather than GEM/lib/

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.

2011/2/28 Iñaki Baz C. [email protected]:

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/ ?

Solved. Using “create_makefile(dir/name)” does the work (thanks to Luis
Lavena).

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs