2

I've had the same mini_racer update problem that others have had, but the common recommendations aren't working for me.

Getting the following errors when running bundle install with mini_racer 0.2.0 in my gemfile...

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

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

I am trying to just update mini_racer with

bundle update mini_racer

but then when I run bundle install, I'm getting a new (and more alarming) error...

Bundler could not find compatible versions for gem "bundler":
In Gemfile:
rails (~> 5.1.4) was resolved to 5.1.6, which depends on
  bundler (>= 1.3.0)

render_async was resolved to 2.0.0, which depends on
  bundler (~> 1.8)

Current Bundler version:
bundler (2.0.1)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 1.8)', which is required by gem 
'rails (~>
5.1.4)', in any of the sources.

What should I be doing to update mini_racer without updating dependencies? (at least i think that is what is happening)

kelly1025
  • 343
  • 3
  • 10
  • This looks like it could be related to the recent bundler update to 2.0; your error message is about bundler. Take a look here: https://stackoverflow.com/a/54068004/2892779 – Jay Dorsey Jan 07 '19 at 02:57
  • I just tried uninstall and reinstalling v 1.17.3 like the link suggested but I am still having the same problem with mini racer. I had seen a post that I should update mini racer, but when I update mini racer I also update rails which wreaks chaos on everything else. – kelly1025 Jan 08 '19 at 04:05
  • The mini racer error looks like it's due to missing dependencies. You might try installing GCC with Homebrew. `brew install gcc`. Then bundle install again. You do NOT want to `bundle update mini_racer`, that's what is trying to upgrade your rails – Jay Dorsey Jan 08 '19 at 13:24

2 Answers2

1

Your first failure is due to a missing dependency with mini racer. The key in that error message is:

library not found for -lstdc++

You need to install gcc. If you're using Homebrew, you can run brew install gcc

The reason that rails was getting screwed up, is because when you ran the bundle update command it looks like it was updating everything, including dependencies. I believe there is a bundler flag to force it to only update the gems you selected, but that still won't help you because you're missing the dependencies needed by mini racer.

After you install gcc, just run bundle install. That should install mini racer without error.

The bundler error, as I noted, was due to a recent update to bundler. I've locked to 1.17.3 for the time being because I haven't had luck working around that error message.

Jay Dorsey
  • 3,563
  • 2
  • 18
  • 24
0

Figured out a workaround.

The issue was that heroku doesn't support bundler 2.0 and above, and if we updated mini_racer it was updating bundler so in order to make mini_racer and heroku happy, we updated mini_racer in the gemfile and specified the most recent version, and then we always use

gem install bundler --version 1.16.4

until heroku supports a more recent bundler version.

kelly1025
  • 343
  • 3
  • 10