1

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)

Pavan Vasan
  • 391
  • 1
  • 9
  • 28
  • 1
    Possible duplicate: [ld: library not found for -lstdc++.6](https://stackoverflow.com/questions/51060596/ld-library-not-found-for-lstdc-6). tl;dr: This library was deprecated in XCode 8, removed in XCode 10. – Amadan Dec 25 '18 at 10:42
  • did you try running `xcode-select --install`? – S R Dec 27 '18 at 12:18

1 Answers1

0

So I am using ubuntu and I found the missing lib in another folder

  • I created the folder mkdir -p /home/edimo/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux/libv8/obj/
  • Copied the lib for the propper location cp /home/edimo/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux-musl/libv8/obj/libv8_monolith.a /home/edimo/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/libv8-node-16.10.0.0-x86_64-linux-musl/vendor/v8/x86_64-linux/libv8/obj/
edimossilva
  • 86
  • 1
  • 4