I am trying to set up my local environment for a particular repository when I came across this error.
An error occurred while installing mini_racer (0.1.15), and Bundler cannot continue.
Make sure that `gem install mini_racer -v '0.1.15' --source 'https://rubygems.org/'` succeeds before bundling.
My local machine is a macOS X (Mojave). I installed ruby 2.1.5, updated the bundler and ran bundle install
This is the error in detail:-
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
current directory: /Users/pavan7vasan/.rvm/gems/ruby-2.1.5/gems/mini_racer-0.1.15/ext/mini_racer_extension
/Users/pavan7vasan/.rvm/rubies/ruby-2.1.5/bin/ruby -r ./siteconf20181225-93631-97fmbf.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
creating Makefile
current directory: /Users/pavan7vasan/.rvm/gems/ruby-2.1.5/gems/mini_racer-0.1.15/ext/mini_racer_extension
make "DESTDIR=" clean
current directory: /Users/pavan7vasan/.rvm/gems/ruby-2.1.5/gems/mini_racer-0.1.15/ext/mini_racer_extension
make "DESTDIR="
compiling mini_racer_extension.cc
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
In file included from mini_racer_extension.cc:2:
In file included from /Users/pavan7vasan/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby.h:33:
In file included from /Users/pavan7vasan/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby/ruby.h:1694:
/Users/pavan7vasan/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby/intern.h:47:19: warning: 'register' storage class specifier is deprecated and incompatible with C++17
[-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
/Users/pavan7vasan/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby/intern.h:47:36: warning: 'register' storage class specifier is deprecated and incompatible with C++17
[-Wdeprecated-register]
void rb_mem_clear(register VALUE*, register long);
^~~~~~~~~
2 warnings generated.
linking shared-object mini_racer_extension.bundle
clang: warning: libstdc++ is deprecated; move to libc++ [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [mini_racer_extension.bundle] Error 1
make failed, exit code 2
Gem files will remain installed in /Users/pavan7vasan/.rvm/gems/ruby-2.1.5/gems/mini_racer-0.1.15 for inspection.
Results logged to /Users/pavan7vasan/.rvm/gems/ruby-2.1.5/extensions/x86_64-darwin-18/2.1.0/mini_racer-0.1.15/gem_make.out
An error occurred while installing mini_racer (0.1.15), and Bundler cannot continue.
Make sure that `gem install mini_racer -v '0.1.15' --source 'https://rubygems.org/'` succeeds before bundling.
In Gemfile:
mini_racer
I researched the problem based on a relevant link: https://github.com/discourse/mini_racer/issues/104
and based on a couple of stack overflow posts, I uninstalled the libv8 gem and then tried to gem install mini_racer
. Unfortunately, it did not work
Even reinstalling ruby again did not have any effect. How can I resolve this problem?
This stack overflow post is for a problem similar to minesimilar post, and it says that setting up a different version is probably the best, not quite sure which is the best version for ruby (2.1.5) and rails (3.2.xx)