If you try to install (or update) the sqlite3 ruby gem on FreeBSD, you might get the following error:
sudo gem update sqlite3
Updating installed gems
Fetching: sqlite3-1.3.5.gem (100%)
Building native extensions. This could take a while...
ERROR: Error installing sqlite3:
ERROR: Failed to build gem native extension.
checking for sqlite3.h... no
sqlite3.h is missing. Try 'port install sqlite3 +universal'
or 'yum install sqlite-devel' and check your shared library search path (the
location where your sqlite3 shared library is located).
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers. Check the mkmf.log file for more
details. You may need configuration options.
Provided configuration options:
Gem files will remain installed in /usr/local/lib/ruby/gems/1.8/gems/sqlite3-1.3.5 for inspection.
Results logged to /usr/local/lib/ruby/gems/1.8/gems/sqlite3-1.3.5/ext/sqlite3/gem_make.out
Nothing to update
The gem doesn’t include the correct locations to check for the sqlite3 headers, so we’ll have to tell it where to look ourself:
sudo CONFIGURE_ARGS="with-sqlite3-include=/usr/local/include" gem install sqlite3