Figured it out, there was another flag to add. Buried deep in the log file behind all the warnings there was one integer-conversion error, so adding an ignore flag to this solved the problem. Full command was: gem install sqlite3 -v 1.4.2 -- --with-cflags="--with-cflags=-g -O0 -std=c11 -Wno-error=implicit-function-declaration -Wno-error=incompatible-function-pointer-types -Wno-error=int-conversion"