Error on installing mailcatcher

The command:

gem install mailcatcher

fails with error:

 - ERROR: Error installing mailcatcher: ERROR: Failed to build gem native extension
make "DESTDIR="
compiling parser.c
parser.rl:112:17: warning: comparison of integers of different signs: 'long' and 'unsigned long' [-Wsign-compare]
  assert(pe - p == len - off && "pointers aren't same distance");
         ~~~~~~ ^  ~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
    (__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
                        ^
parser.rl:142:7: error: implicit declaration of function 'thin_http_parser_has_error' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  if (thin_http_parser_has_error(parser) ) {
      ^
parser.rl:142:7: note: did you mean 'http_parser_has_error'?
./parser.h:44:5: note: 'http_parser_has_error' declared here
int http_parser_has_error(http_parser *parser);
    ^
parser.rl:144:14: error: implicit declaration of function 'thin_http_parser_is_finished' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
  } else if (thin_http_parser_is_finished(parser) ) {
             ^
1 warning and 2 errors generated.
make: *** [parser.o] Error 1

make failed, exit code 2

Solution

gem install mailcatcher -- --with-cflags="-Wno-error=implicit-function-declaration"