I can't seem to get gem install charlock_holmes -v to work.

I can hand edit the ./ext/charlock_holmes/extconf.rb and includ

$INCFLAGS << " -I/usr/local/include "
$LDFLAGS << " -L/usr/local/lib "

execute make cleanly and re-write the spec file via

gem spec ../../cache/charlock_holmes- --ruby > ../../specifications/charlock_holmes- 

and make it a local gem.

  1. How do I get the gem to install?
  2. There must be a better way to append what amounts to CPPFLAGS and LDFLAGS to the gem install.

1 Answer 1


It appears the suffix --with-cppflags=-I/usr/local/include and --with-ldflags=-L/usr/local/lib resulting in

gem install charlock_holmes -v -- --with-cppflags=-I/usr/local/include --with-ldflags=-L/usr/local/lib

Accomplishes both 1 & 2 from above.

Not the answer you're looking for? Browse other questions tagged or ask your own question.