Mini_racer 0.2.0 causing bundler to fail

I am upgrading Discourse to 2.1.6 from 1.9.6, and I cannot get through bundle install. I am using Docker (ubuntu 16.04) as the base image to build discourse. Ruby version 2.3.0. When I get to bundle install, I get the following compilation error. Urgent Help! Not sure what else I’m missing…


Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory:
/usr/local/rbenv/versions/2.3.0/bin/ruby -r ./siteconf20190111-14622-1sr4cny.rb
checking for main() in -lpthread... yes
creating Makefile

To see why this extension failed to compile, please check the mkmf.log which can
be found here:


current directory:
make "DESTDIR=" clean

current directory:
make "DESTDIR="
In file included from
                 from In function 'VALUE protected_callback(VALUE)':
/usr/local/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))))
/usr/local/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)
/usr/local/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'
                                                  ^ note: in expansion of macro 'RARRAY_PTR'
Makefile:206: recipe for target 'mini_racer_extension.o' failed
make: *** [mini_racer_extension.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mini_racer-0.2.0 for
Results logged to

An error occurred while installing mini_racer (0.2.0), and Bundler cannot
Make sure that `gem install mini_racer -v '0.2.0' --source
''` succeeds before bundling.

In Gemfile:

Looking at the gems getting installed, I do see this (which I believe is what mini_racer depends on):

Fetching libv8 (x86_64-linux)

Installing libv8 (x86_64-linux)

Please follow our official install guide: discourse/ at master · discourse/discourse · GitHub