rocksdb-ruby installs fine with Ruby 2.2.4. With Ruby 2.3.0, however, I'm getting the following error:
$ bundle install
Fetching gem metadata from https://rubygems.org/..
Fetching version metadata from https://rubygems.org/.
Installing rocksdb-ruby 0.1.2 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/ubuntu/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rocksdb-ruby-0.1.2/ext/rocksdb
/home/ubuntu/.rbenv/versions/2.3.0/bin/ruby -r ./siteconf20160201-84189-1j74nfh.rb extconf.rb
checking for rocksdb/db.h... yes
checking for main() in -lrocksdb... yes
creating Makefile
To see why this extension failed to compile, please check the mkmf.log which can be found here:
/home/ubuntu/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/rocksdb-ruby-0.1.2/mkmf.log
current directory: /home/ubuntu/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rocksdb-ruby-0.1.2/ext/rocksdb
make "DESTDIR=" clean
current directory: /home/ubuntu/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rocksdb-ruby-0.1.2/ext/rocksdb
make "DESTDIR="
compiling rocksdb_batch_rb.cc
compiling rocksdb_db_rb.cc
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 ‘-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]
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/ubuntu/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby.h:33:0,
from rocksdb_rb.h:10,
from rocksdb_db_rb.cc:1:
rocksdb_db_rb.cc: In function ‘VALUE rocksdb_db_multi_get(VALUE, VALUE)’:
/home/ubuntu/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:882:52: error: ‘__builtin_choose_expr’ was not declared in this scope
OBJ_WB_UNPROTECT((VALUE)(obj)), ((VALUE)(obj))))
^
/home/ubuntu/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:1039:48: note: in definition of macro ‘RARRAY_CONST_PTR’
#define RARRAY_CONST_PTR(a) rb_array_const_ptr(a)
^
/home/ubuntu/.rbenv/versions/2.3.0/include/ruby-2.3.0/ruby/ruby.h:1059:50: note: in expansion of macro ‘RB_OBJ_WB_UNPROTECT_FOR’
#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(ARRAY, a)))
^
rocksdb_db_rb.cc:122:18: note: in expansion of macro ‘RARRAY_PTR’
VALUE *tmp = RARRAY_PTR(v_array);
^
make: *** [rocksdb_db_rb.o] Error 1
make: *** Waiting for unfinished jobs....
make failed, exit code 2
Gem files will remain installed in /home/ubuntu/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/rocksdb-ruby-0.1.2 for inspection.
Results logged to /home/ubuntu/.rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/rocksdb-ruby-0.1.2/gem_make.out
Using bundler 1.11.2
An error occurred while installing rocksdb-ruby (0.1.2), and Bundler cannot continue.
Make sure that `gem install rocksdb-ruby -v '0.1.2'` succeeds before bundling.
Here is the mkmf.log it references (not sure if helpful):
rocksdb-ruby installs fine with Ruby 2.2.4. With Ruby 2.3.0, however, I'm getting the following error:
Here is the mkmf.log it references (not sure if helpful):
This is with rocksdb master (https://github.com/facebook/rocksdb/commit/1d854fa3d46cc8da984b5f70ec7856917bb52e70). Let me know if there's anything else I can do to help debug this!