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/lib/ruby/gems/2.3.0/gems/mini_racer-0.2.0/ext/mini_racer_extension
/usr/local/rbenv/versions/2.3.0/bin/ruby -r ./siteconf20190111-14622-1sr4cny.rb
extconf.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:

/usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/mini_racer-0.2.0/mkmf.log

current directory:
/usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mini_racer-0.2.0/ext/mini_racer_extension
make "DESTDIR=" clean

current directory:
/usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/gems/mini_racer-0.2.0/ext/mini_racer_extension
make "DESTDIR="
compiling mini_racer_extension.cc
In file included from
/usr/local/rbenv/versions/2.3.0/include/ruby-2.3.0/ruby.h:33:0,
                 from mini_racer_extension.cc:2:
mini_racer_extension.cc: 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'
#define RARRAY_PTR(a) ((VALUE *)RARRAY_CONST_PTR(RB_OBJ_WB_UNPROTECT_FOR(ARRAY,
a)))
                                                  ^
mini_racer_extension.cc:850:9: note: in expansion of macro 'RARRAY_PTR'
         RARRAY_PTR(data->ruby_args));
         ^
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
inspection.
Results logged to
/usr/local/rbenv/versions/2.3.0/lib/ruby/gems/2.3.0/extensions/x86_64-linux/2.3.0-static/mini_racer-0.2.0/gem_make.out

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

In Gemfile:
  mini_racer

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

Fetching libv8 6.7.288.46.1 (x86_64-linux)

Installing libv8 6.7.288.46.1 (x86_64-linux)

Please follow our official install guide: https://github.com/discourse/discourse/blob/master/docs/INSTALL-cloud.md

5 Likes