[RAILS] I get an error with bundle install and puma cannot be installed.

Error that occurs

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/yohei-yokota/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/puma-4.3.3/ext/puma_http11
/Users/yohei-yokota/.rbenv/versions/2.6.1/bin/ruby -I
/Users/yohei-yokota/.rbenv/versions/2.6.1/lib/ruby/2.6.0 -r
./siteconf20200920-91266-1229hke.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
checking for openssl/bio.h... yes
checking for DTLS_method() in openssl/ssl.h... yes
checking for TLS_server_method() in openssl/ssl.h... yes
checking for SSL_CTX_set_min_proto_version in openssl/ssl.h... yes
creating Makefile

current directory:
/Users/yohei-yokota/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/puma-4.3.3/ext/puma_http11
make "DESTDIR=" clean

current directory:
/Users/yohei-yokota/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/puma-4.3.3/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/puma_http11/http11_parser.c:44:18: warning: unused variable
'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
                 ^
1 warning generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:145:7: warning: unused variable 'min' [-Wunused-variable]
  int min, ssl_options;
      ^
mini_ssl.c:299:40: warning: function 'raise_error' could be declared with
attribute 'noreturn' [-Wmissing-noreturn]
void raise_error(SSL* ssl, int result) {
                                       ^
2 warnings generated.
compiling puma_http11.c
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

Gem files will remain installed in
/Users/yohei-yokota/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/puma-4.3.3
for inspection.
Results logged to
/Users/yohei-yokota/.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-19/2.6.0/puma-4.3.3/gem_make.out

An error occurred while installing puma (4.3.3), and Bundler cannot
continue.
Make sure that `gem install puma -v '4.3.3' --source 'https://rubygems.org/'`
succeeds before bundling.

In Gemfile:
  puma

It does not occur in puma v4.2.1, but seems to occur in v4.3.0 or later.

I just executed the following command.

$ gem install puma:4.3.3 -- --with-cflags="-Wno-error=implicit-function-declaration"

Reference link

https://github.com/puma/puma/issues/2342 https://github.com/puma/puma/issues/2304

Recommended Posts

I get an error with bundle install and puma cannot be installed.
[Rails 6] MySQL 2 cannot be bundle install
When deploying EC2, bundle install cannot be performed and an error of Undefined local variable or method `git_source'for Gemfile appears.
I don't see an error in Rails bundle install ... the solution
[Ruby on Rails] bundle install fails "An error occurred while installing pg (1.2.3), and Bundler cannot continue."
Add gem'rails-i18n','~> 6.0.0' and what to do if bundle install gives an error
I can deploy Heroku, but I get an error and can't open it
What to do if you get an error with bundle install by entering gem'bcrypt' in your Gemfile
When I renew the certificate with CircleCI × fastlane, I get an exit status: 65 error.
bundle install error
I get an error when adding a dependency
Error with bundle install after upgrading to Catalina
bundle install error
About the error caused by bundle install ~ puma Gem ~
When I bcrypt with node + docker, I got an error
I struggled with pip install on an M1 Mac
Error when bundle install
How to change Java version and execute in an environment where Java cannot be installed freely
When starting Eclipse debug, I get a `ERROR: JDWP Transport dt_socket failed` error and cannot start.
I can deploy to heroku, but I get an error and can't open it [Cause: MySQL]
I changed the Ruby version and now I can't bundle install
I got an error when using nextInt, nextLine and substring.
After setting database to mysql, bundle install causes an error
Note when pip install mysqlclient cannot be installed on Mac
Difference between bundle and bundle install
I get a 404 error when testing forms authentication with Spring Security
I got an error and couldn't push! !! [error: failed to push some refs to]
If the bundle install command on the Docker container ends with an error at code: 15, check the BUNDLE_PATH setting