redis / hiredis

Minimalistic C client for Redis >= 1.2
BSD 3-Clause "New" or "Revised" License
6.22k stars 1.81k forks source link

`bundle install` raise error, can not install hiredis #1184

Closed 1c7 closed 1 year ago

1c7 commented 1 year ago
image
Fetching gem metadata from https://rubygems.org/..........
Using rake 13.0.6
Using concurrent-ruby 1.1.9
Using i18n 1.10.0
Using minitest 5.15.0
Using thread_safe 0.3.6
Using tzinfo 1.2.9
Using zeitwerk 2.5.4
Using activesupport 6.0.3.6
Using builder 3.2.4
Using erubi 1.10.0
Using mini_portile2 2.8.0
Using racc 1.6.0
Using nokogiri 1.13.3 (arm64-darwin)
Using rails-dom-testing 2.0.3
Using crass 1.0.6
Using loofah 2.14.0
Using rails-html-sanitizer 1.4.2
Using actionview 6.0.3.6
Using rack 2.2.3
Using rack-test 1.1.0
Using actionpack 6.0.3.6
Using nio4r 2.5.8
Using websocket-extensions 0.1.5
Using websocket-driver 0.7.5
Using actioncable 6.0.3.6
Using globalid 1.0.0
Using activejob 6.0.3.6
Using activemodel 6.0.3.6
Using activerecord 6.0.3.6
Using marcel 1.0.2
Using activestorage 6.0.3.6
Using mini_mime 1.1.2
Using mail 2.7.1
Using actionmailbox 6.0.3.6
Using actionmailer 6.0.3.6
Using actiontext 6.0.3.6
Using ast 2.4.2
Using awesome_print 1.9.2
Using bundler 2.1.4
Using byebug 11.1.3
Using diff-lcs 1.5.0
Using hashids 1.0.6
Fetching hiredis 0.4.5
Installing hiredis 0.4.5 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/Users/zheng-cheng/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hiredis-0.4.5/ext/hiredis_ext
/Users/zheng-cheng/.rbenv/versions/2.7.2/bin/ruby -I
/Users/zheng-cheng/.rbenv/versions/2.7.2/lib/ruby/2.7.0 -r ./siteconf20230426-41820-o2pnp4.rb extconf.rb
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb net.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb hiredis.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb sds.c
cc -std=c99 -pedantic -c -O3 -fPIC  -Wall -W -Wstrict-prototypes -Wwrite-strings -g -ggdb async.c
ar rcs libhiredis.a net.o hiredis.o sds.o async.o
creating Makefile

current directory:
/Users/zheng-cheng/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hiredis-0.4.5/ext/hiredis_ext
make "DESTDIR=" clean

current directory:
/Users/zheng-cheng/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hiredis-0.4.5/ext/hiredis_ext
make "DESTDIR="
compiling connection.c
connection.c:44:58: warning: function 'parent_context_raise' could be declared with attribute 'noreturn'
[-Wmissing-noreturn]
static void parent_context_raise(redisParentContext *pc) {
                                                         ^
connection.c:88:9: error: call to undeclared function 'rb_thread_select'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_thread_select(fd + 1, &fds, NULL, NULL, toptr) < 0) {
        ^
connection.c:112:9: error: call to undeclared function 'rb_thread_select'; ISO C99 and later do not
support implicit function declarations [-Wimplicit-function-declaration]
    if (rb_thread_select(fd + 1, NULL, &fds, NULL, toptr) < 0) {
        ^
1 warning and 2 errors generated.
make: *** [connection.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/zheng-cheng/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/hiredis-0.4.5 for inspection.
Results logged to
/Users/zheng-cheng/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/extensions/arm64-darwin-22/2.7.0/hiredis-0.4.5/gem_make.out

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

In Gemfile:
  mp_logger was resolved to 0.9.0, which depends on
    hiredis
1c7 commented 1 year ago

This is a Rails Engine project, written by my coworker

image
1c7 commented 1 year ago
image
bjosv commented 1 year ago

I would guess this issue fits better in the https://github.com/redis/hiredis-rb project? The v0.4.5 seems to be from 2012 so maybe a newer version will work?

1c7 commented 1 year ago

Thanks I would give it a try

1c7 commented 1 year ago

Done

Before

spec.add_dependency 'hiredis'

After

spec.add_dependency 'hiredis', '~> 0.6.3'
image

Specifying newest version fix my issue

image