Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot install puma gem #2327

Closed
wickahead opened this issue Aug 5, 2020 · 3 comments
Closed

Cannot install puma gem #2327

wickahead opened this issue Aug 5, 2020 · 3 comments

Comments

@wickahead
Copy link

Trying to install Puma gem (and it fails). Any help is appreciated (wouldn't be surprised if user error...)

Working on my own Mac as a dev machine (learning Rails)
Running macOS 10.15.6 (Catalina)

ruby -v
ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-darwin19]

gem install puma
...fails due to permission (should it?). I then try:
sudo gem install puma
...which gives me the following warnings and errors:

markwicker@Marks20cBookPro ~ % sudo gem install puma
Password:
Building native extensions. This could take a while...
ERROR: Error installing puma:
ERROR: Failed to build gem native extension.

current directory: /Users/markwicker/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/puma-4.3.5/ext/puma_http11

/Users/markwicker/.rbenv/versions/2.6.3/bin/ruby -I /Users/markwicker/.rbenv/versions/2.6.3/lib/ruby/2.6.0 -r ./siteconf20200805-854-1bd435e.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/markwicker/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/puma-4.3.5/ext/puma_http11
make "DESTDIR=" clean

current directory: /Users/markwicker/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/puma-4.3.5/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/markwicker/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/gems/puma-4.3.5 for inspection.
Results logged to /Users/markwicker/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/extensions/x86_64-darwin-19/2.6.0/puma-4.3.5/gem_make.out

@MSP-Greg
Copy link
Member

MSP-Greg commented Aug 5, 2020

@wickahead

First of all, the warnings are normal. Puma '5.x' branch is currently prerelease, which may cause issues with other software you're using. But, the following should work, which will install 5.0.0.beta1.

Otherwise, a patch needs to be added to 4.x builds for installing on macOS/darwin, or it needs to be installed via Bundler using a git source based on PR #2314

gem install puma --prerelease

@dentarg
Copy link
Member

dentarg commented Aug 6, 2020

@wickahead see comments #2304 (comment) and #2304 (comment) for a workaround

@wickahead
Copy link
Author

Thank you both for your responses. Comment #2304

@wickahead see comments #2304 (comment) and #2304 (comment) for a workaround

That did the trick! Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants