I understand that this issue has a ton of answers on stack overflow (and other sites) but none of them seem to work for me. Here is where the issue arises. When I tried to run my server, this error popped up:
Could not find nio4r-1.2.1 in any of the sources
So I ran bundle install which threw this error:
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
Make sure that `gem install nio4r -v '1.2.1' --source 'https://rubygems.org/'` succeeds before bundling.
When I do that, this happens:
ERROR: Failed to build gem native extension.
current directory: /Users/admin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
/Users/admin/.rbenv/versions/2.3.1/bin/ruby -r ./siteconf20201129-28103-lmj40x.rb extconf.rb
checking for unistd.h... yes
checking for rb_thread_blocking_region()... no
checking for rb_thread_call_without_gvl()... yes
checking for sys/select.h... yes
checking for poll.h... yes
checking for sys/epoll.h... no
checking for sys/event.h... yes
checking for sys/queue.h... yes
checking for port.h... no
checking for sys/resource.h... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/admin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/nio4r-1.2.1/mkmf.log
current directory: /Users/admin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
make "DESTDIR=" clean
current directory: /Users/admin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1/ext/nio4r
make "DESTDIR="
compiling monitor.c
compiling nio4r_ext.c
In file included from nio4r_ext.c:7:
./../libev/ev.c:487:48: warning: '/*' within block comment [-Wcomment]
/*#define MIN_INTERVAL 0.00000095367431640625 /* 1/2**20, good till 2200 */
^
./../libev/ev.c:1829:31: warning: 'extern' variable has an initializer [-Wextern-initializer]
EV_API_DECL struct ev_loop *ev_default_loop_ptr = 0; /* needs to be initialised to make it a definition despite extern */
^
In file included from nio4r_ext.c:7:
In file included from ./../libev/ev.c:2694:
./../libev/ev_poll.c:110:18: warning: expression result unused [-Wunused-value]
assert (("libev: poll() returned illegal result, broken BSD kernel?", p < polls + pollcnt));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3100:12: warning: expression result unused [-Wunused-value]
assert (("libev: watcher has invalid priority", ABSPRI (w) >= 0 && ABSPRI (w) < NUMPRI));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3103:14: warning: expression result unused [-Wunused-value]
assert (("libev: pending watcher not on pending queue", pendings [ABSPRI (w)][w->pending - 1].w == w));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3113:16: warning: expression result unused [-Wunused-value]
assert (("libev: active index mismatch in heap", ev_active (ANHE_w (heap [i])) == i));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3114:16: warning: expression result unused [-Wunused-value]
assert (("libev: heap condition violated", i == HEAP0 || ANHE_at (heap [HPARENT (i)]) <= ANHE_at (heap [i])));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3115:16: warning: expression result unused [-Wunused-value]
assert (("libev: heap at cache mismatch", ANHE_at (heap [i]) == ev_at (ANHE_w (heap [i]))));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3126:16: warning: expression result unused [-Wunused-value]
assert (("libev: active index mismatch", ev_active (ws [cnt]) == cnt + 1));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3144:14: warning: expression result unused [-Wunused-value]
assert (("libev: negative fd in fdchanges", fdchanges [i] >= 0));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3157:24: warning: expression result unused [-Wunused-value]
assert (("libev: io watcher list contains a loop", w != w2));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3161:20: warning: expression result unused [-Wunused-value]
assert (("libev: inactive fd watcher on anfd list", ev_active (w) == 1));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3162:20: warning: expression result unused [-Wunused-value]
assert (("libev: fd mismatch between watcher and anfd", ((ev_io *)w)->fd == i));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3344:24: warning: expression result unused [-Wunused-value]
assert (("libev: negative ev_timer repeat value found while processing timers", w->repeat > 0.));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3406:24: warning: expression result unused [-Wunused-value]
assert (("libev: ev_periodic reschedule callback returned time in the past", ev_at (w) >= ev_rt_now));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3551:1: warning: non-void function does not return a value [-Wreturn-type]
}
^
./../libev/ev.c:3568:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_loop recursion during release detected", loop_done != EVBREAK_RECURSE));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3737:9: error: implicit declaration of function 'rb_thread_call_without_gvl' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_thread_call_without_gvl(ev_backend_poll, (void *)&poll_args, RUBY_UBF_IO, 0);
^
./../libev/ev.c:3752:22: warning: expression result unused [-Wunused-value]
assert (("libev: pipe_w not active, but pipe not written", ev_is_active (&pipe_w)));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3926:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_io_start called with negative fd", fd >= 0));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3927:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_io_start called with illegal event mask", !(w->events & ~(EV__IOFDSET | EV_READ | EV_WRITE))));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3936:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_io_start called with corrupted watcher", ((WL)w)->next != (WL)w));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3951:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_io_stop called with illegal fd (must stay constant after start!)", w->fd >= 0 && w->fd < anfdmax));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3971:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_timer_start called with negative timer repeat value", w->repeat >= 0.));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:3999:14: warning: expression result unused [-Wunused-value]
assert (("libev: internal timer heap corruption", ANHE_w (timers [active]) == (WT)w));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:4061:16: warning: expression result unused [-Wunused-value]
assert (("libev: ev_periodic_start called with negative interval value", w->interval >= 0.));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:4093:14: warning: expression result unused [-Wunused-value]
assert (("libev: internal periodic heap corruption", ANHE_w (periodics [active]) == (WT)w));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:4130:12: warning: expression result unused [-Wunused-value]
assert (("libev: ev_signal_start called with illegal signal number", w->signum > 0 && w->signum < EV_NSIG));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:4133:12: warning: expression result unused [-Wunused-value]
assert (("libev: a signal must not be attached to two different loops",
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:4251:12: warning: expression result unused [-Wunused-value]
assert (("libev: child watchers are only supported in the default loop", loop == ev_default_loop_ptr));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
In file included from nio4r_ext.c:7:
./../libev/ev.c:4830:14: warning: expression result unused [-Wunused-value]
assert (("libev: loop to be embedded is not embeddable", backend & ev_embeddable_backends ()));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
30 warnings and 1 error generated.
make: *** [nio4r_ext.o] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/admin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/gems/nio4r-1.2.1 for inspection.
Results logged to /Users/admin/.rbenv/versions/2.3.1/lib/ruby/gems/2.3.0/extensions/x86_64-darwin-18/2.3.0-static/nio4r-1.2.1/gem_make.out
The things I have tried so far are:
Updating xcode and accepting terms. - sudo xcodebuild -license accept
Installing nio4r using this command - bundle config build.nio4r --with-cflags="-std=c99" then gem install nio4r -v '1.2.1' -- with-cflags="-std=c99"
Tried installing libgmp3-dev for mac via brew install gmp
There was a stack answer which mentioned postgres file port.h which needed to be deleted. That didn't work for me either.
I am running Mac OS Catalina(Recently upgraded). When I upgraded I also had to upgrade my Xcode - Version 12.2 (12B45b)
I am running ruby version 2.3.1
If anyone has experienced this after catalina upgrade and has a solution, please help. I'd be happy to provide more info if needed.
You can disable this error with option -Wno-error=implicit-function-declaration
So try this
gem install nio4r -v '1.2.1' -- --with-cflags="-Wno-error=implicit-function-declaration"
You can add the same option for bundler:
bundle config --local build.nio4r --with-cflags="-Wno-error=implicit-function-declaration"
# and then
bundle install
I seen this problem yesterday and my problem solved code:
sudo gem install rails
I'm getting the following error and wonder how should I solve it
I'm getting this error when trying to run gem install re2 -v 1.1.1
However, run gem install re2 -v 1.2.0 works perfectly for me in the same directory.
Building native extensions. This could take a while...
ERROR: Error installing re2:
ERROR: Failed to build gem native extension.
current directory: /home/aaron/.rvm/gems/ruby-2.5.3/gems/re2-1.1.1/ext/re2
/home/aaron/.rvm/rubies/ruby-2.5.3/bin/ruby -I /home/aaron/.rvm/rubies/ruby-2.5.3/lib/ruby/site_ruby/2.5.0 -r ./siteconf20200629-12178-1dryx90.rb extconf.rb
checking for -lstdc++... yes
checking for stdint.h... yes
checking for rb_str_sublen()... yes
checking for -lre2... yes
checking for re2 requires C++11 compiler... yes
checking for RE2::Match() with endpos argument... yes
creating Makefile
current directory: /home/aaron/.rvm/gems/ruby-2.5.3/gems/re2-1.1.1/ext/re2
make "DESTDIR=" clean
current directory: /home/aaron/.rvm/gems/ruby-2.5.3/gems/re2-1.1.1/ext/re2
make "DESTDIR="
compiling re2.cc
cc1plus: warning: command line option ‘-Wimplicit-int’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wdeclaration-after-statement’ is valid for C/ObjC but not for C++ [enabled by default]
cc1plus: warning: command line option ‘-Wimplicit-function-declaration’ is valid for C/ObjC but not for C++ [enabled by default]
In file included from /home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/ruby.h:29:0,
from /home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby.h:33,
from re2.cc:9:
/home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/defines.h:286:44: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
# define EXTERN __pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: "\
^
In file included from /home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/intern.h:24:0,
from /home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/ruby.h:2040,
from /home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby.h:33,
from re2.cc:9:
/home/aaron/.rvm/rubies/ruby-2.5.3/include/ruby-2.5.0/ruby/defines.h:286:44: warning: invalid suffix on literal; C++11 requires a space between literal and identifier [-Wliteral-suffix]
# define EXTERN __pragma(message(__FILE__"("STRINGIZE(__LINE__)"): warning: "\
^
re2.cc: In function ‘VALUE re2_scanner_scan(VALUE)’:
re2.cc:261:37: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1"));
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_matchdata_to_a(VALUE)’:
re2.cc:459:35: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1"));
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_matchdata_nth_match(int, VALUE)’:
re2.cc:483:33: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_matchdata_inspect(VALUE)’:
re2.cc:614:29: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_regexp_initialize(int, VALUE*, VALUE)’:
re2.cc:687:19: error: ‘class re2::RE2::Options’ has no member named ‘set_utf8’
re2_options.set_utf8(RTEST(utf8));
^
re2.cc: In function ‘VALUE re2_regexp_inspect(VALUE)’:
re2.cc:770:29: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_regexp_to_s(VALUE)’:
re2.cc:788:29: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_regexp_utf8(VALUE)’:
re2.cc:818:42: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
return BOOL2RUBY(p->pattern->options().utf8());
^
re2.cc:21:23: note: in definition of macro ‘BOOL2RUBY’
#define BOOL2RUBY(v) (v ? Qtrue : Qfalse)
^
re2.cc: In function ‘VALUE re2_regexp_error_arg(VALUE)’:
re2.cc:1015:31: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_regexp_options(VALUE)’:
re2.cc:1046:39: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
BOOL2RUBY(p->pattern->options().utf8()));
^
re2.cc:21:23: note: in definition of macro ‘BOOL2RUBY’
#define BOOL2RUBY(v) (v ? Qtrue : Qfalse)
^
re2.cc: In function ‘VALUE re2_regexp_named_capturing_groups(VALUE)’:
re2.cc:1116:33: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1"),
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_Replace(VALUE, VALUE, VALUE, VALUE)’:
re2.cc:1287:31: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_GlobalReplace(VALUE, VALUE, VALUE, VALUE)’:
re2.cc:1324:31: error: ‘const class re2::RE2::Options’ has no member named ‘utf8’
p->pattern->options().utf8() ? "UTF-8" : "ISO-8859-1");
^
re2.cc:37:36: note: in definition of macro ‘ENCODED_STR_NEW’
int _enc = rb_enc_find_index(encoding); \
^
re2.cc: In function ‘VALUE re2_regexp_utf8(VALUE)’:
re2.cc:819:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
At global scope:
cc1plus: warning: unrecognized command line option "-Wno-self-assign" [enabled by default]
cc1plus: warning: unrecognized command line option "-Wno-constant-logical-operand" [enabled by default]
cc1plus: warning: unrecognized command line option "-Wno-parentheses-equality" [enabled by default]
cc1plus: warning: unrecognized command line option "-Wno-tautological-compare" [enabled by default]
make: *** [re2.o] Error 1
make failed, exit code 2
Gem files will remain installed in /home/aaron/.rvm/gems/ruby-2.5.3/gems/re2-1.1.1 for inspection.
Results logged to /home/aaron/.rvm/gems/ruby-2.5.3/extensions/x86_64-linux/2.5.0/re2-1.1.1/gem_make.out
You have to use 2017-07-01 version of re2 lib for re2 gem 1.1.1
I am running bundle install to gems but it is failing for some gems.
Currently, it's breaking for puma gem (An error occurred while installing puma (3.6.0), and Bundler cannot continue).
these are the logs for the same
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/Users/pusingh/.rvm/gems/ruby-2.3.7#pm/extensions/x86_64-darwin-19/2.3.0/puma-3.6.0/mkmf.log
current directory: /Users/pusingh/.rvm/gems/ruby-2.3.7#pm/gems/puma-3.6.0/ext/puma_http11
make "DESTDIR=" clean
current directory: /Users/pusingh/.rvm/gems/ruby-2.3.7#pm/gems/puma-3.6.0/ext/puma_http11
make "DESTDIR="
compiling http11_parser.c
ext/puma_http11/http11_parser.rl:111:17: warning: comparison of integers of different signs: 'long' and 'unsigned long'
[-Wsign-compare]
assert(pe - p == len - off && "pointers aren't same distance");
~~~~~~ ^ ~~~~~~~~~
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/assert.h:93:25: note: expanded from macro 'assert'
(__builtin_expect(!(e), 0) ? __assert_rtn(__func__, __FILE__, __LINE__, #e) : (void)0)
^
ext/puma_http11/http11_parser.c:43:18: warning: unused variable 'puma_parser_en_main' [-Wunused-const-variable]
static const int puma_parser_en_main = 1;
^
2 warnings generated.
compiling io_buffer.c
compiling mini_ssl.c
mini_ssl.c:90:5: error: incomplete definition of type 'struct dh_st'
dh->p = BN_bin2bn(dh1024_p, sizeof(dh1024_p), NULL);
~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:91:5: error: incomplete definition of type 'struct dh_st'
dh->g = BN_bin2bn(dh1024_g, sizeof(dh1024_g), NULL);
~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:93:10: error: incomplete definition of type 'struct dh_st'
if ((dh->p == NULL) || (dh->g == NULL)) {
~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:93:29: error: incomplete definition of type 'struct dh_st'
if ((dh->p == NULL) || (dh->g == NULL)) {
~~^
/usr/local/opt/openssl/include/openssl/ossl_typ.h:104:16: note: forward declaration of 'struct dh_st'
typedef struct dh_st DH;
^
mini_ssl.c:197:27: warning: 'DTLSv1_method' is deprecated [-Wdeprecated-declarations]
conn->ctx = SSL_CTX_new(DTLSv1_method());
^
/usr/local/opt/openssl/include/openssl/ssl.h:1895:1: note: 'DTLSv1_method' has been explicitly marked deprecated here
DEPRECATEDIN_1_1_0(__owur const SSL_METHOD *DTLSv1_method(void)) /* DTLSv1.0 */
^
/usr/local/opt/openssl/include/openssl/opensslconf.h:155:34: note: expanded from macro 'DEPRECATEDIN_1_1_0'
# define DEPRECATEDIN_1_1_0(f) DECLARE_DEPRECATED(f)
^
/usr/local/opt/openssl/include/openssl/opensslconf.h:118:55: note: expanded from macro 'DECLARE_DEPRECATED'
# define DECLARE_DEPRECATED(f) f __attribute__ ((deprecated));
^
mini_ssl.c:233:20: warning: implicit conversion loses integer precision: 'long' to 'int' [-Wshorten-64-to-32]
int verify_err = SSL_get_verify_result(ssl);
~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~
mini_ssl.c:246:13: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32]
err = ERR_get_error();
~ ^~~~~~~~~~~~~~~
3 warnings and 4 errors generated.
make: *** [mini_ssl.o] Error 1
make failed, exit code 2
I am using ruby 2.3.7 with catalina mac os 10.15.5 Please help
I am trying to install SWOOLE on my Ubuntu-16.04
I tried this sudo pecl install swoole
But am getting a long list of errors(Skipped some lines)
In file included from /tmp/pear/temp/swoole/php_swoole.h:156:0,
from /tmp/pear/temp/swoole/swoole.c:16:
/tmp/pear/temp/swoole/php7_wrapper.h: In function 'sw_zend_is_callable':
/tmp/pear/temp/swoole/php7_wrapper.h:238:5: error: unknown type name 'zend_string'
zend_string *key = NULL;
^
/tmp/pear/temp/swoole/php7_wrapper.h:239:5: warning: passing argument 3 of 'zend_is_callable' from incompatible pointer type [enabled by default]
int ret = zend_is_callable(cb, a, &key);
^
In file included from /usr/include/php5/main/php.h:39:0,
from /tmp/pear/temp/swoole/php_swoole.h:25,
from /tmp/pear/temp/swoole/swoole.c:16:
/usr/include/php5/Zend/zend_API.h:301:20: note: expected 'char **' but argument is of type 'int **'
ZEND_API zend_bool zend_is_callable(zval *callable, uint check_flags, char **callable_name TSRMLS_DC);
^
In file included from /usr/include/php5/Zend/zend.h:252:0,
from /usr/include/php5/main/php.h:35,
from /tmp/pear/temp/swoole/php_swoole.h:25,
from /tmp/pear/temp/swoole/swoole.c:16:
/tmp/pear/temp/swoole/php7_wrapper.h:240:29: error: request for member 'val' in something not a structure or union
char *tmp = estrndup(key->val, key->len);
^
/usr/include/php5/Zend/zend_alloc.h:78:44: note: in definition of macro 'estrndup'
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
^
/tmp/pear/temp/swoole/php7_wrapper.h:240:39: error: request for member 'len' in something not a structure or union
char *tmp = estrndup(key->val, key->len);
^
/usr/include/php5/Zend/zend_alloc.h:78:49: note: in definition of macro 'estrndup'
#define estrndup(s, length) _estrndup((s), (length) ZEND_FILE_LINE_CC ZEND_FILE_LINE_EMPTY_CC)
^
In file included from /tmp/pear/temp/swoole/php_swoole.h:156:0,
from /tmp/pear/temp/swoole/swoole.c:16:
/tmp/pear/temp/swoole/php7_wrapper.h: In function 'sw_zend_is_callable_ex':
/tmp/pear/temp/swoole/php7_wrapper.h:248:5: error: unknown type name 'zend_string'
zend_string *key = NULL;
^
/tmp/pear/temp/swoole/php7_wrapper.h:249:5: warning: passing argument 4 of 'zend_is_callable_ex' from incompatible pointer type [enabled by default]
int ret = zend_is_callable_ex(callable, NULL, check_flags, &key, fcc, error);
make: *** [swoole.lo] Error 1
ERROR: `make' failed
I have also tried this
cd swoole-src
./configure
make
Which is also giving the similar errors.
How to solve this? thanks in advance!
EDIT : Added the first Generated ERRORS too
When I compile the code I get an error telling me my 'EC_GROUP_set_curve_GF2m' function was not declared in this scope. I've researched the error message and I can't figure out what to do to fix it.
from:github bubichain-v3
My Centos 7 is newly installed and installed software package:
sudo yum install -y automake autoconf libtool g++ libssl-dev cmake libbz2-dev python
Error info:
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In static member function ‘static EC_GROUP* utils::EccSm2::NewGroup(utils::EccSm2::GROUP_TYPE, std::string, std::string, std::string, std::string, std::string, std::string)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:211:48: error: ‘EC_GF2m_simple_method’ was not declared in this scope
group = EC_GROUP_new(EC_GF2m_simple_method());
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:216:53: error: ‘EC_GROUP_set_curve_GF2m’ was not declared in this scope
if (!EC_GROUP_set_curve_GF2m(group, p, a, b, ctx)) {
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:221:63: error: ‘EC_POINT_set_affine_coordinates_GF2m’ was not declared in this scope
EC_POINT_set_affine_coordinates_GF2m(group, G, xG, yG, ctx);
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In static member function ‘static std::string utils::EccSm2::getZA(EC_GROUP*, std::string, const EC_POINT*)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:255:66: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
EC_POINT_get_affine_coordinates_GF2m(group, pkey, xA, yA, NULL);
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:264:62: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
EC_POINT_get_affine_coordinates_GF2m(group, G, xG, yG, ctx);
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘bool utils::EccSm2::From(std::string)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:334:71: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
if (!EC_POINT_get_affine_coordinates_GF2m(group_, pkey_, x, y, ctx)) {
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘bool utils::EccSm2::NewRandom()’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:376:71: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
if (!EC_POINT_get_affine_coordinates_GF2m(group_, pkey_, x, y, ctx)) {
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘std::string utils::EccSm2::Sign(const string&, const string&)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:473:74: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
if (!EC_POINT_get_affine_coordinates_GF2m(group_, pt1, x1, NULL, ctx)) {
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In static member function ‘static int utils::EccSm2::verify(EC_GROUP*, const string&, const string&, const string&, const string&)’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:586:69: error: ‘EC_POINT_set_affine_coordinates_GF2m’ was not declared in this scope
EC_POINT_set_affine_coordinates_GF2m(group, pub_key, xp, yp, NULL);
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp:643:73: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
if (!EC_POINT_get_affine_coordinates_GF2m(group, point, x1, NULL, ctx)) {
^
/home/bubichain-v3/src/utils/ecc_sm2.cpp: In member function ‘std::string utils::EccSm2::GetPublicKey()’:
/home/bubichain-v3/src/utils/ecc_sm2.cpp:698:72: error: ‘EC_POINT_get_affine_coordinates_GF2m’ was not declared in this scope
EC_POINT_get_affine_coordinates_GF2m(group_, pkey_, bn_x, bn_y, NULL);
^
make[3]: *** [utils/CMakeFiles/bubi_utils.dir/ecc_sm2.cpp.o] Error 1
make[3]: Leaving directory `/home/bubichain-v3/build/linux'
make[2]: *** [utils/CMakeFiles/bubi_utils.dir/all] Error 2
make[2]: *** Waiting for unfinished jobs....
/usr/bin/cmake -E cmake_progress_report /home/bubichain-v3/build/linux/CMakeFiles 44
This solution is work for me:
Step 1: I assume that your present working directory is the Ruby source directory.
Step 2: Download the patch as shown below:
# wget https://bugs.ruby-lang.org/attachments/download/3707/out.patch
# ls out.patch
out.patch
# find . -name ossl_pkey_ec.c
./ext/openssl/ossl_pkey_ec.c
Step 4: Run the downloaded patch
# patch ./ext/openssl/ossl_pkey_ec.c < out.patch
patching file ./ext/openssl/ossl_pkey_ec.c
Hunk #1 succeeded at 757 (offset -5 lines).
Hunk #2 succeeded at 814 (offset -5 lines).
patching file ./ext/openssl/ossl_pkey_ec.c
Hunk #1 FAILED at 7.
1 out of 1 hunk FAILED -- saving rejects to file ./ext/openssl/ossl_pkey_ec.c.rej