mailcatcher icon indicating copy to clipboard operation
mailcatcher copied to clipboard

Mac BigSur 11.11.2 installation error

Open reynoldspaul opened this issue 3 years ago • 4 comments

Following error on new install

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
Fetching thin-1.5.1.gem
Fetching rack-1.6.13.gem
Fetching daemons-1.3.1.gem
Fetching eventmachine-1.0.9.1.gem
Fetching rack-protection-1.5.5.gem
Fetching skinny-0.2.4.gem
Fetching tilt-2.0.10.gem
Fetching sinatra-1.4.8.gem
Fetching mini_mime-1.0.3.gem
Fetching mail-2.7.1.gem
Fetching mailcatcher-0.7.1.gem
Successfully installed daemons-1.3.1
Building native extensions. This could take a while...
Successfully installed eventmachine-1.0.9.1
Successfully installed rack-1.6.13
Building native extensions. This could take a while...
ERROR:  Error installing mailcatcher:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/thin-1.5.1/ext/thin_parser
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210331-19927-63j625.rb extconf.rb
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin20/rbconfig.rb:229: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040777
checking for main() in -lc... yes
creating Makefile

current directory: /Library/Ruby/Gems/2.6.0/gems/thin-1.5.1/ext/thin_parser
make "DESTDIR=" clean

current directory: /Library/Ruby/Gems/2.6.0/gems/thin-1.5.1/ext/thin_parser
make "DESTDIR="
compiling parser.c
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) ) {
             ^
2 errors generated.
make: *** [parser.o] Error 1

make failed, exit code 2

reynoldspaul avatar Mar 31 '21 10:03 reynoldspaul

I had same issue, and it worked when I tried this: gem install mailcatcher -- --with-cflags="-Wno-error=implicit-function-declaration"

AhmedNadar avatar Apr 02 '21 09:04 AhmedNadar

This issue is purportedly fixed in Thin 1.8.0, so if the version constraint is adjusted maybe the issue would go away?

mockdeep avatar May 20 '21 23:05 mockdeep

The workaround for now is:

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

The long term fix will be moving away from thin.

sj26 avatar Jul 15 '21 01:07 sj26

Or just use a docker image https://hub.docker.com/r/stpaquet/alpinemailcatcher ;-) I found this approach being the most efficient as you do not have to worry about the version of Ruby installed on your system since you do not need Ruby on your environment to be installed.

spaquet avatar Mar 29 '22 16:03 spaquet

I got a different error with openssl at first and then the above error. Finally was able to install on ruby 3.1.3, mac M1, with this. command:

gem install mailcatcher -- --with-openssl-dir=$(brew --prefix openssl) --with-cflags="-Wno-error=implicit-function-declaration"

reynardmh avatar Jan 19 '23 16:01 reynardmh

I have pushed another pre-release, v0.9.0.beta2, which relaxes the thin requirement and avoid this compilation error. Please try it:

gem install mailcatcher --pre

sj26 avatar Jan 29 '23 23:01 sj26