[August 2020] If the installation of cool.io / puma fails

Problem overview

As of August 2020, the installation of cool.io used for puma and fluentd may fail.

current directory: /Users/example/src/nature-server/vendor/bundle/ruby/2.6.0/gems/cool.io-1.6.0/ext/cool.io
make "DESTDIR=" clean
current directory: /Users/example/src/nature-server/vendor/bundle/ruby/2.6.0/gems/cool.io-1.6.0/ext/cool.io
make "DESTDIR="
compiling cool.io_ext.c
In file included from cool.io_ext.c:11:
In file included from ./cool.io.h:11:
/Users/example/.rbenv/versions/2.6.6/include/ruby-2.6.0/ruby/backward/rubyio.h:2:2: warning: use "ruby/io.h" instead of "rubyio.h" [-W#warnings]
#warning use "ruby/io.h" instead of "rubyio.h"
....

Solution

The solution is to set --with-cflags ="-Wno-error = implicit-function-declaration ". Reference Issue :) ctype.h missing from puma_http11.c

For bundle:

bundle config --local build.cool.io --with-cflags="-Wno-error=implicit-function-declaration"
bundle config --local build.puma --with-cflags="-Wno-error=implicit-function-declaration"

If you want to install gem directly:

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

Recommended Posts

[August 2020] If the installation of cool.io / puma fails
What to do if the debug gem installation fails
The question of which is better, if or switch
Is there an instance even if the constructor fails?
SSL in the local environment of Docker / Rails / puma