title: How can you solve the mini_racer 0.2.4 compilation issue to solve a Bundler dependency on Fedora 31?
body: <p>Landing on an existing Rails project, I encounter some difficulty with setting up the environment, which makes pop up the infamous "dependency hell" in my head. It seems limited to mini_racer 0.2.4 though.</p>
  
  <p>Here is how it goes:</p>
  
  <pre><code>bundle install
  # […] lot of working stuffs
  Fetching libv8 6.7.288.46.1 (x86_64-linux)
  Installing libv8 6.7.288.46.1 (x86_64-linux)
  # […] more working stuffs
  Fetching mini_racer 0.2.4
  Installing mini_racer 0.2.4 with native extensions
  Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
  
  
      current directory: /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/gems/mini_racer-0.2.4/ext/mini_racer_extension
  /home/psychoslave/.rvm/rubies/ruby-2.5.1/bin/ruby -I /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0 -r ./siteconf20200404-68221-1tr6jr3.rb extconf.rb
  checking for -lpthread... yes
  creating Makefile
  
  current directory: /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/gems/mini_racer-0.2.4/ext/mini_racer_extension
  make "DESTDIR=" clean
  
  current directory: /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/gems/mini_racer-0.2.4/ext/mini_racer_extension
  make "DESTDIR="
  compiling mini_racer_extension.cc
  cc1plus: warning: command line option '-Wimplicit-int' is valid for C/ObjC but not for C++
  mini_racer_extension.cc: In function 'void prepare_result(v8::MaybeLocal&lt;v8::Value&gt;, v8::TryCatch&amp;, v8::Isolate*, v8::Local&lt;v8::Context&gt;, EvalResult&amp;)':
  mini_racer_extension.cc:234:73: error: no matching function for call to 'v8::Value::ToObject()'
    234 |                         String::NewFromUtf8(isolate, "JSON"))-&gt;ToObject();
        |                                                                         ^
  In file included from mini_racer_extension.cc:4:
  /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/gems/libv8-7.3.492.27.1-x86_64-linux/vendor/v8/include/v8.h:2390:44: note: candidate: 'v8::MaybeLocal&lt;v8::Object&gt;
  v8::Value::ToObject(v8::Local&lt;v8::Context&gt;) const'
   2390 |   V8_WARN_UNUSED_RESULT MaybeLocal&lt;Object&gt; ToObject(
        |                                            ^~~~~~~~
  […]
  [A lot of other compiling errors]
  […]
  At global scope:
  cc1plus: warning: unrecognized command line option '-Wno-self-assign'
  cc1plus: warning: unrecognized command line option '-Wno-constant-logical-operand'
  cc1plus: warning: unrecognized command line option '-Wno-parentheses-equality'
  make: *** [Makefile:210: mini_racer_extension.o] Error 1
  
  make failed, exit code 2
  
  Gem files will remain installed in /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/gems/mini_racer-0.2.4 for inspection.
  Results logged to /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/extensions/x86_64-linux/2.5.0/mini_racer-0.2.4/gem_make.out
  
  An error occurred while installing mini_racer (0.2.4), and Bundler cannot continue.
  Make sure that `gem install mini_racer -v '0.2.4' --source 'https://rubygems.org/'` succeeds before bundling.
  
  In Gemfile:
    mini_racer
  </code></pre>
  
  <p>Browsing the web, one can easily find <a href="https://github.com/jules2689/extended_bundler-errors/issues/4" rel="nofollow noreferrer">mini-racer failing to compile · Issue #4 · jules2689/extended_bundler-errors</a> leading to <a href="https://github.com/jules2689/extended_bundler-errors/commit/d0eb62c8a381e293878a337901dba64238f65e64" rel="nofollow noreferrer">Add mini_racer handling</a>. From this I tried <code>gem uninstall libv8 &amp;&amp; gem install mini_racer -v '0.2.4' --source 'https://rubygems.org/</code> but it fails to compile just as above.</p>
  
  <p>Now, running <code>bundle update &amp;&amp; bundle install</code> works like a charm, so I thought I might just go with this for now and see with the rest of the team if we might update at least the mini-racer gem. Then I started to complete the README.md to add some details and wanted to commit in a new branch and ask review. But it happens that the team use overcommit to add some git hooks which are crashing as it includes Brakeman which depends on mini_racer-0.2.4:</p>
  
  <pre><code>git commit -m"Add more detailed procedure on how to install on Fedora 31"
  Running pre-commit hooks
  Analyze with RailsBestPractices..................[RailsBestPractices] OK
  Check for vulnerable versions of gems...................[BundleAudit] WARNING
  Run Brakeman...............................................[Brakeman] FAILED
  /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/spec_set.rb:91:in `block in materialize': Could not find mini_racer-0.2.4 in any of the sources (Bundler::GemNotFound)
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/spec_set.rb:85:in `map!'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/spec_set.rb:85:in `materialize'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/definition.rb:170:in `specs'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/definition.rb:237:in `specs_for'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/definition.rb:226:in `requested_specs'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:108:in `block in definition_method'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/runtime.rb:20:in `setup'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler.rb:107:in `setup'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/bundler/setup.rb:20:in `&lt;top (required)&gt;'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
      from /home/psychoslave/.rvm/rubies/ruby-2.5.1/lib/ruby/site_ruby/2.5.0/rubygems/core_ext/kernel_require.rb:54:in `require'
  
  Run YarnLint...............................................[YarnLint] OK
  
  ✗ One or more pre-commit hooks failed
  </code></pre>
  
  <p>Summary of the development platform: </p>
  
  <ul>
  <li>Fedora 31 with an out of the box GCC 9.3.1 20200317 (Red Hat 9.3.1-1)</li>
  <li>RVM 1.29.10</li>
  <li>Bundler version 1.17.3</li>
  <li>Ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]</li>
  <li>Rails 5.2.2</li>
  <li>PATH: /home/psychoslave/.rvm/gems/ruby-2.5.1@the_project/bin:/home/psychoslave/.rvm/gems/ruby-2.5.1@global/bin:/home/psychoslave/.rvm/rubies/ruby-2.5.1/bin:/home/psychoslave/.local/bin:/home/psychoslave/.local/bin:/home/psychoslave/bin:/home/psychoslave/.local/bin:/home/psychoslave/.config/nvm/versions/node/v8.12.0/bin:/home/psychoslave/.local/bin:/home/psychoslave/.local/bin:/home/psychoslave/bin:/usr/share/Modules/bin:/usr/local/bin:/usr/local/sbin:/usr/bin:/usr/sbin:/home/psychoslave/.rvm/bin</li>
  <li>LIBRARY_PATH, CPATH, C_INCLUDE_PATH, CPLUS_INCLUDE_PATH are empty</li>
  </ul>
  
  <p>What steps would you recommand to solve this depency issue?</p>