Mailcatcher gem installation issue on MacOS Catalina and its solution

I faced this issue a few weeks back and was able to resolve it in the following manner.
The mailcatcher gem as of writing this depends on thin-1.5.1 which doesn’t install correctly.

Now, if you face the issue, uninstall the thin gem. Then,

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

And you should be good to go.

Here’s the StackOverflow link I followed with some tweaks.


Discourse actually is very happy to fund up to say $3000 dollars for a mailcatcher rewrite/fork that junks event machine and replaces it with @ioquatix async and family instead. (and allowing this to work with say puma instead of thin)

At the moment mailcatcher is stuck on an old version of event machine, and the community has mostly moved on from using event machine.

If you or anyone is interested contact me via a PM.

End result of the work is

  • Remove mailcatcher gem
  • Add new gem to Discourse
  • Everything works exactly the same dev wise as it used to

Also prior to forking the gem I would recommend a PR to mailcatcher the de-event machines it… and to discuss with the maintainer.