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

Unable to install latest version 2.12.0 on Ubuntu 14.04 #737

Closed
dmill opened this issue Jul 15, 2015 · 3 comments
Closed

Unable to install latest version 2.12.0 on Ubuntu 14.04 #737

dmill opened this issue Jul 15, 2015 · 3 comments

Comments

@dmill
Copy link

dmill commented Jul 15, 2015

I'm unable to install the latest version of puma on an Ubuntu 14.04 VirtualBox VM. I get the following error:

vagrant@default-ubuntu-1404:~$ sudo gem install puma
Building native extensions.  This could take a while...
ERROR:  Error installing puma:
    ERROR: Failed to build gem native extension.

    /usr/bin/ruby2.2 -r ./siteconf20150715-18099-6juzas.rb extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling http11_parser.c
compiling io_buffer.c
compiling mini_ssl.c
In file included from mini_ssl.c:3:0:
/usr/include/ruby-2.2.0/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp]
 #warning use "ruby/io.h" instead of "rubyio.h"
  ^
mini_ssl.c: In function ‘raise_error’:
mini_ssl.c:236:3: error: format not a string literal and no format arguments [-Werror=format-security]
   rb_raise(eError, msg);
   ^
mini_ssl.c:215:15: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result]
     strerror_r(err, buf, sizeof(buf));
               ^
cc1: some warnings being treated as errors
make: *** [mini_ssl.o] Error 1

make failed, exit code 2

I am using Chef and the community puma cookbook to bootstrap my node, and everything works fine when I lock the puma version to 2.11.2. Anyone have any thoughts?

@tetherit
Copy link

+1 any workaround?

@petrblaho
Copy link

The similar problem on Fedora 22.

/usr/bin/ruby extconf.rb
checking for BIO_read() in -lcrypto... yes
checking for SSL_CTX_new() in -lssl... yes
creating Makefile

make "DESTDIR=" clean
rm -f 
rm -f puma_http11.so  *.o  *.bak mkmf.log .*.time

make "DESTDIR="
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.   -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic -fPIC -m64 -o io_buffer.o -c io_buffer.c
io_buffer.c: In function ‘buf_to_str’:
io_buffer.c:119:21: warning: pointer targets in passing argument 1 of ‘rb_str_new’ differ in signedness [-Wpointer-sign]
   return rb_str_new(b->top, b->cur - b->top);
                     ^
In file included from /usr/include/ruby/ruby.h:1694:0,
                 from /usr/include/ruby.h:33,
                 from io_buffer.c:2:
/usr/include/ruby/intern.h:704:7: note: expected ‘const char *’ but argument is of type ‘uint8_t *’
 VALUE rb_str_new(const char*, long);
       ^
gcc -I. -I/usr/include -I/usr/include/ruby/backward -I/usr/include -I.   -fPIC -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -mtune=generic -fPIC -m64 -o mini_ssl.o -c mini_ssl.c
In file included from mini_ssl.c:3:0:
/usr/include/ruby/backward/rubyio.h:2:2: warning: #warning use "ruby/io.h" instead of "rubyio.h" [-Wcpp]
 #warning use "ruby/io.h" instead of "rubyio.h"
  ^
mini_ssl.c: In function ‘raise_error’:
mini_ssl.c:236:3: error: format not a string literal and no format arguments [-Werror=format-security]
   rb_raise(eError, msg);
   ^
mini_ssl.c: In function ‘engine_read’:
mini_ssl.c:242:14: warning: unused variable ‘n’ [-Wunused-variable]
   int bytes, n, error;
              ^
mini_ssl.c: In function ‘engine_peercert’:
mini_ssl.c:341:28: warning: pointer targets in passing argument 1 of ‘rb_str_new’ differ in signedness [-Wpointer-sign]
   rb_cert_buf = rb_str_new(buf, bytes);
                            ^
In file included from /usr/include/ruby/ruby.h:1694:0,
                 from /usr/include/ruby.h:33,
                 from mini_ssl.c:2:
/usr/include/ruby/intern.h:704:7: note: expected ‘const char *’ but argument is of type ‘unsigned char *’
 VALUE rb_str_new(const char*, long);
       ^
mini_ssl.c: In function ‘raise_error’:
mini_ssl.c:215:5: warning: ignoring return value of ‘strerror_r’, declared with attribute warn_unused_result [-Wunused-result]
     strerror_r(err, buf, sizeof(buf));
     ^
cc1: some warnings being treated as errors
Makefile:225: recipe for target 'mini_ssl.o' failed
make: *** [mini_ssl.o] Error 1

make failed, exit code 2

It is probably due to strict compiler flags used in most of new linux distros.

@petrblaho
Copy link

Thanks for quick solution.

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

2 participants