Update
This issue should be fixed, and the current recommendation is to upgrade Puma, for example:
# Gemfile
#
# Either:
# gem 'puma', '~> 4.3.6'
#
# Or:
# gem 'puma', '~> 5.0'
[The below solution(s) are specified for v4.3.5
, and should continue to work for that version.]
Original discussion
The following error has been appearing for some users installing Puma on macOS:
puma_http11.c:203:22: error: implicitly declaring library function 'isspace' with type 'int (int)' [-Werror,-Wimplicit-function-declaration] while (vlen > 0 && isspace(value[vlen - 1])) vlen--;
puma_http11.c:203:22: note: include the header <ctype.h> or explicitly provide a declaration for 'isspace'
1 error generated.
make: *** [puma_http11.o] Error 1
make failed, exit code 2
There is some discussion about a relevant change to Big Sur that is documented in release notes:
New in macOS Big Sur 11 beta, the system ships with a built-in dynamic linker cache of all system-provided libraries. As part of this change, copies of dynamic libraries are no longer present on the filesystem. Code that attempts to check for dynamic library presence by looking for a file at a path or enumerating a directory will fail. Instead, check for library presence by attempting to
dlopen()
the path, which will correctly check for the library in the cache. (62986286)
However this issue is present in macOS Catalina as well.
There are a couple of potential fixes for the problem:
RubyGems install
Run the following:
$ gem install puma:4.3.5 -- --with-cflags="-Wno-error=implicit-function-declaration"
Bundler install
Or:
$ bundle config build.puma --with-cflags="-Wno-error=implicit-function-declaration"
$ bundle install
The latter was tested and confirmed on Catalina.