versatica / OverSIP

OverSIP: the SIP framework you dreamed about
http://oversip.versatica.com
Other
340 stars 68 forks source link

Failed to install on macOS with any ruby 2.x #105

Open qiulang opened 6 years ago

qiulang commented 6 years ago

macOS 10.13.5 Xcode Version 9.4.1 (9F2000)

rvm list
=> ruby-2.1.10 [ x86_64 ]
 * ruby-2.2.10 [ x86_64 ]

rvm use ruby-2.1.10
gem install oversip

...
Building native extensions. This could take a while...
ERROR:  Error installing oversip:
    ERROR: Failed to build gem native extension.

      current directory: /Users/qiulang/.rvm/gems/ruby-2.1.10/gems/oversip-2.0.4/ext/stud
/Users/qiulang/.rvm/rubies/ruby-2.1.10/bin/ruby -r ./siteconf20180702-20108-ofkamg.rb extconf.rb
[ext/stud/extconf.rb] executing system command: tar -zxf stud.tar.gz
[ext/stud/extconf.rb] RbConfig::CONFIG['host_os'] returns "darwin17.6.0"
[ext/stud/extconf.rb] executing system command: make
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.
...
extconf.rb:14:in `sys': [ext/stud/extconf.rb] system command `make' failed (RuntimeError)
    from extconf.rb:35:in `block (2 levels) in <main>'
    from extconf.rb:27:in `chdir'
    from extconf.rb:27:in `block in <main>'
    from extconf.rb:24:in `chdir'
    from extconf.rb:24:in `<main>'
rvm use ruby-2.2.10
gem install oversip

...

em.cpp:810:9: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
        return EmSelect (maxsocket+1, &fdreads, &fdwrites, &fderrors, &tv);
               ^~~~~~~~
               rb_thread_fd_select
./em.h:25:20: note: expanded from macro 'EmSelect'
  #define EmSelect rb_thread_select
                   ^
/Users/qiulang/.rvm/rubies/ruby-2.2.10/include/ruby-2.2.0/ruby/intern.h:455:5: note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
    ^
em.cpp:810:32: error: cannot initialize a parameter of type 'rb_fdset_t *' with an rvalue of type 'fd_set *'
        return EmSelect (maxsocket+1, &fdreads, &fdwrites, &fderrors, &tv);
                                      ^~~~~~~~
/Users/qiulang/.rvm/rubies/ruby-2.2.10/include/ruby-2.2.0/ruby/intern.h:455:42: note: passing argument to parameter here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
                                         ^
em.cpp:949:6: error: use of undeclared identifier 'rb_thread_select'; did you mean 'rb_thread_fd_select'?
                                        EmSelect (0, NULL, NULL, NULL, &tv);
                                        ^~~~~~~~
                                        rb_thread_fd_select
./em.h:25:20: note: expanded from macro 'EmSelect'
  #define EmSelect rb_thread_select
                   ^
/Users/qiulang/.rvm/rubies/ruby-2.2.10/include/ruby-2.2.0/ruby/intern.h:455:5: note: 'rb_thread_fd_select' declared here
int rb_thread_fd_select(int, rb_fdset_t *, rb_fdset_t *, rb_fdset_t *, struct timeval *);
    ^
3 errors generated.
make: *** [em.o] Error 1

....
qiulang commented 6 years ago

I found it failed on ubuntu ruby 2.1 as well, the same error

Building native extensions. This could take a while... ERROR: Error installing oversip: ERROR: Failed to build gem native extension.

current directory: /usr/local/rvm/gems/ruby-2.1.0/gems/oversip-2.0.4/ext/stud

/usr/local/rvm/rubies/ruby-2.1.0/bin/ruby -r ./siteconf20180703-22519-10dy4b9.rb extconf.rb [ext/stud/extconf.rb] executing system command: tar -zxf stud.tar.gz [ext/stud/extconf.rb] RbConfig::CONFIG['host_os'] returns "linux-gnu" [ext/stud/extconf.rb] executing system command: make extconf.rb failed Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

qiulang commented 6 years ago

I used ruby 2.4.4 to rake the latest codes that use EventMachine. But I still get the same error as 2.1.

Can anyone give me some suggestion ?

extconf.rb:14:in `sys': [ext/stud/extconf.rb] system command `make' failed (RuntimeError)
        from extconf.rb:35:in `block (2 levels) in <main>'
        from extconf.rb:27:in `chdir'
        from extconf.rb:27:in `block in <main>'
        from extconf.rb:24:in `chdir'
        from extconf.rb:24:in `<main>'
rake aborted!

Checking the mkmf.log shows

"tar -zxf stud.tar.gz"
make
cc -O2 -g -std=c99 -fno-strict-aliasing -Wall -W -D_GNU_SOURCE -I/usr/local/include -I/usr/include/libev   -c -o stud.o stud.c
stud.c:56:10: fatal error: 'openssl/x509.h' file not found
#include <openssl/x509.h>
         ^~~~~~~~~~~~~~~~
1 error generated.
make: *** [stud.o] Error 1

/usr/local/opt/openssl/include actually has openssl/x509.h, but how do I set it ?