I was trying ‘Bundle install’ to set up discourse from Beginners Guide to Install Discourse on Ubuntu for Development. But I’m stuck at the below-mentioned error.
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /home/vagrant/.rvm/gems/ruby-2.7.3/gems/mini_racer-0.4.0/ext/mini_racer_extension
/home/vagrant/.rvm/rubies/ruby-2.7.3/bin/ruby -I /home/vagrant/.rvm/rubies/ruby-2.7.3/lib/ruby/2.7.0 -r ./siteconf20210617-10955-nyj538.rb extconf.rb
checking for -lpthread... yes
creating Makefile
current directory: /home/vagrant/.rvm/gems/ruby-2.7.3/gems/mini_racer-0.4.0/ext/mini_racer_extension
make "DESTDIR=" clean
current directory: /home/vagrant/.rvm/gems/ruby-2.7.3/gems/mini_racer-0.4.0/ext/mini_racer_extension
make "DESTDIR="
compiling mini_racer_extension.cc
mini_racer_extension.cc: In function ‘void* gvl_ruby_callback(void*)’:
mini_racer_extension.cc:1086:94: warning: ‘VALUE ruby::backward::cxxanyargs::rb_rescue2(VALUE (*)(...), VALUE, VALUE (*)(...), VALUE, ...)’ is deprecated: Use of ANYARGS in this function is deprecated [-Wdeprecated-declarations]
(VALUE(*)(...))&rescue_callback, (VALUE)(&callback_data), rb_eException, (VALUE)0);
^
In file included from /home/vagrant/.rvm/rubies/ruby-2.7.3/include/ruby-2.7.0/ruby/ruby.h:2863:0,
from /home/vagrant/.rvm/rubies/ruby-2.7.3/include/ruby-2.7.0/ruby.h:33,
from mini_racer_extension.cc:2:
/home/vagrant/.rvm/rubies/ruby-2.7.3/include/ruby-2.7.0/ruby/backward/cxxanyargs.hpp:222:1: note: declared here
rb_rescue2(type *q, VALUE w, type *e, VALUE r, ...)
^~~~~~~~~~
linking shared-object mini_racer_extension.so
/usr/bin/x86_64-linux-gnu-ld: /home/vagrant/.rvm/gems/ruby-2.7.3/gems/libv8-node-15.14.0.1-x86_64-linux-musl/vendor/v8/out.gn/libv8/obj/libv8_monolith.a(api.o): unrecognized relocation (0x2a) in section
`.text._ZN2v89ExtensionD2Ev[_ZN2v89ExtensionD5Ev]'
/usr/bin/x86_64-linux-gnu-ld: final link failed: Bad value
collect2: error: ld returned 1 exit status
make: *** [mini_racer_extension.so] Error 1
make failed, exit code 2
Gem files will remain installed in /home/vagrant/.rvm/gems/ruby-2.7.3/gems/mini_racer-0.4.0 for inspection.
Results logged to /home/vagrant/.rvm/gems/ruby-2.7.3/extensions/x86_64-linux/2.7.0/mini_racer-0.4.0/gem_make.out
An error occurred while installing mini_racer (0.4.0), and Bundler cannot continue.
Make sure that `gem install mini_racer -v '0.4.0' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
mini_racer
Kindly help.