Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Fixing libv8 and therubyracer on Mac
brew tap homebrew/versions
brew install v8-315
gem install libv8 -v '3.16.14.13' -- --with-system-v8
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
bundle install
@Alphabetus

This comment has been minimized.

Copy link

@Alphabetus Alphabetus commented Jun 18, 2019

Still works on 2019!
ruby 2.2.5

Thanks

@fernandoaleman

This comment has been minimized.

Copy link
Owner Author

@fernandoaleman fernandoaleman commented Jun 18, 2019

@Alphabetus You're welcome. Glad it helped.

@ZhdanovP

This comment has been minimized.

Copy link

@ZhdanovP ZhdanovP commented Jul 16, 2019

Hello, @Alphabetus , I am getting the following error during the
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8-315
Do you have guess why it can by?

current directory: /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8 /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20190716-50046-104ausw.rb extconf.rb --with-v8-dir=/usr/local/opt/v8-315 creating Makefile Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/disable-building-tests.patch Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/disable-werror-on-osx.patch Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/disable-xcode-debugging.patch Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/do-not-imply-vfp3-and-armv7.patch Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/do-not-use-MAP_NORESERVE-on-freebsd.patch Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/do-not-use-vfp2.patch Applying /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/patches/fPIC-for-static.patch Compiling v8 for x64 Using python 2.7.15 Using compiler: c++ (Apple LLVM version 10.0.1) Unable to find a compiler officially supported by v8. It is recommended to use GCC v4.4 or higher Beginning compilation. This will take some time. Building v8 with env CXX=c++ LINK=c++ /usr/bin/make x64.release ARFLAGS.target=crs werror=no GYP_GENERATORS=make \ build/gyp/gyp --generator-output="out" build/all.gyp \ -Ibuild/standalone.gypi --depth=. \ -Dv8_target_arch=x64 \ -S.x64 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror='' CXX(target) /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o warning: include path for stdlibc++ headers not found; pass '-stdlib=libc++' on the command line to use the libc++ standard library instead [-Wstdlibcxx-not-found] In file included from ../src/allocation.cc:33: ../src/utils.h:33:10: fatal error: 'climits' file not found #include <climits> ^~~~~~~~~ 1 warning and 1 error generated. make[1]: *** [/Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o] Error 1 make: *** [x64.release] Error 2 /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:36:in block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNotFound)
from /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in each' from /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in verify_installation!'
from /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:26:in install!' from extconf.rb:7:in

'

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/libv8-3.16.14.19 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-18/2.3.0/libv8-3.16.14.19/gem_make.out`

@gurdiga

This comment has been minimized.

Copy link

@gurdiga gurdiga commented Aug 8, 2019

The therubyracer installation didnโ€™t for me, I still got this:

checking for v8.h... no

Here is what worked for me:

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

Good luck! ๐Ÿ™‚

@fernandoaleman

This comment has been minimized.

Copy link
Owner Author

@fernandoaleman fernandoaleman commented Aug 8, 2019

@gurdiga Hey glad that worked for you. That code will definitely be helpful for others using therubyracer. Thanks for sharing! ๐Ÿ‘

I actually stopped using therubyracer and instead started installing the nodejs package for Javascript. So far, it's worked well. ๐Ÿ˜Š

@simshanith

This comment has been minimized.

Copy link

@simshanith simshanith commented Sep 3, 2019

Got it to work, tho homebrew/versions is no longer necessary and the flag is now --with-v8-dir=/usr/local/opt/v8@3.15 due to change of folder versioning.

Same as @gurdiga above ^

@zazk

This comment has been minimized.

Copy link

@zazk zazk commented Sep 3, 2019

Thanks @fernandoaleman, @gurdiga! You guys rocks!

@monteirobrena

This comment has been minimized.

Copy link

@monteirobrena monteirobrena commented Sep 12, 2019

Thank you!

@tvcam

This comment has been minimized.

Copy link

@tvcam tvcam commented Oct 3, 2019

Awesome.

@zismailov

This comment has been minimized.

Copy link

@zismailov zismailov commented Oct 21, 2019

Thank you! 2019

@kokorolx

This comment has been minimized.

Copy link

@kokorolx kokorolx commented Nov 1, 2019

It still working when I use rails 4 and ruby 2.1.1
Thank you!

@nzajt

This comment has been minimized.

Copy link

@nzajt nzajt commented Nov 6, 2019

If you need to do this with macOS 10.15 and ruby 2.3 here it is

brew install v8@3.15
gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8
gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/v8@3.15
bundle install
@gordey4doronin

This comment has been minimized.

Copy link

@gordey4doronin gordey4doronin commented Nov 12, 2019

Confirmed! Still works in Catalina, with small changes in version path, and without additional brew tap. Thanks! ๐Ÿ‘

@kennethkalmer

This comment has been minimized.

Copy link

@kennethkalmer kennethkalmer commented Nov 12, 2019

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install
@TomHoenderdos

This comment has been minimized.

Copy link

@TomHoenderdos TomHoenderdos commented Nov 13, 2019

@kenn

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked perfectly!! For ruby 2.6.5 :D

@kenn

This comment has been minimized.

Copy link

@kenn kenn commented Nov 13, 2019

Please don't mention my username :) Thanks!

@paluchas

This comment has been minimized.

Copy link

@paluchas paluchas commented Nov 29, 2019

Bundler version works perfectly on Catalina + Ruby managed by chruby. Thanks!

Note, that bundle config will update global bundler config file .e.g

$ cat ~/.bundle/config                                                          โœน โœญ
---
BUNDLE_BUILD__LIBV8: "--with-system-v8"
BUNDLE_BUILD__THERUBYRACER: "--with-v8-dir=/usr/local/opt/v8@3.15"
@bpdarlyn

This comment has been minimized.

Copy link

@bpdarlyn bpdarlyn commented Dec 5, 2019

I have Catalina + Ruby 2.6.2 and It doesn't work, could you please tell me the error ?

Fetching libv8 3.16.14.19
Installing libv8 3.16.14.19 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Users/bpdarlyn/.rvm/gems/ruby-2.6.2/gems/libv8-3.16.14.19/ext/libv8
/Users/bpdarlyn/.rvm/rubies/ruby-2.6.2/bin/ruby -I /Users/bpdarlyn/.rvm/rubies/ruby-2.6.2/lib/ruby/site_ruby/2.6.0 -r
./siteconf20191204-32835-fl2n5d.rb extconf.rb --with-cxx\=/usr/local/bin/g\+\+-4.2
creating Makefile
/Users/bpdarlyn/.rvm/gems/ruby-2.6.2/gems/libv8-3.16.14.19/ext/libv8/builder.rb:56:in `block in build_libv8!': No compilers
available (RuntimeError)
	from /Users/bpdarlyn/.rvm/gems/ruby-2.6.2/gems/libv8-3.16.14.19/ext/libv8/builder.rb:54:in `chdir'
	from /Users/bpdarlyn/.rvm/gems/ruby-2.6.2/gems/libv8-3.16.14.19/ext/libv8/builder.rb:54:in `build_libv8!'
	from /Users/bpdarlyn/.rvm/gems/ruby-2.6.2/gems/libv8-3.16.14.19/ext/libv8/location.rb:24:in `install!'
	from extconf.rb:7:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/bpdarlyn/.rvm/gems/ruby-2.6.2/gems/libv8-3.16.14.19 for inspection.
Results logged to /Users/bpdarlyn/.rvm/gems/ruby-2.6.2/extensions/x86_64-darwin-19/2.6.0/libv8-3.16.14.19/gem_make.out

An error occurred while installing libv8 (3.16.14.19), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.19' --source 'https://rubygems.org/'` succeeds before bundling.
cat ~/.bundle/config
---
BUNDLE_BUILD__LIBV8: "--with-system-v8"
BUNDLE_BUILD__THERUBYRACER: "--with-v8-dir=/usr/local/opt/v8@3.15"
@bjoseru

This comment has been minimized.

Copy link

@bjoseru bjoseru commented Dec 12, 2019

I ran into the same problems (on Catalina) and there seem to have been some changes to homebrew. After a lot of trial and error the following worked for me:

  1. Install homebrew into my home directory (I am using MacPorts otherwise, but their v8 is currently broken) under ~/homebrew. You can choose a different folder of course, or choose a global installation instead. In that case all the paths below need to be updated.
 cd
 mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew
  1. As I am not planning to use homebrew in the future, I don't add it to PATH, just make it available short term like so:
alias brew="~/homebrew/bin/brew"
  1. Update homebrew's knowledge about older versions. This replaces the brew tap homebrew/versions step.
git -C "$(brew --repo homebrew/core)" fetch --unshallow
  1. Proceed to install this old version of v8 that rubyracer wants:
brew install v8@3.15

Now check where this actually went to, for me it is under ~/homebrew/opt/v8@3.15. This locations should contain include/v8.h.

  1. Find an appropriate gem version of libv8 and install it.
# check for name of v8 install directory, then
gem list libv8 --remote --all # => 3.16.14.19 is seems like a good candidate
gem install libv8 -v 3.16.14.19 -- --with-system-v8

In the second command I also had --with-v8-dir=~/homebrew/opt/v8@3.15 but I don't think it did anything, so I removed it here.

  1. Install rubyracer like so. Importantly, do not use a relative path, use an absolute path for the installation directory of v8:
gem install therubyracer -- --with-v8-dir=/Users/<your username here>/homebrew/opt/v8@3.15 # here the absolute path is VITAL

And that is it. Good luck!

@bjoseru

This comment has been minimized.

Copy link

@bjoseru bjoseru commented Dec 12, 2019

PS: In case you previously installed other (newer, but non-working) versions of libv8, likely by using the --with-system-v8 option, and likely so that they don't actually work, then remove them with gem uninstall before you follow the instructions above.

@wlchn

This comment has been minimized.

Copy link

@wlchn wlchn commented Dec 13, 2019

@bjoseru thanks, wroks for macOS 10.15 and ruby-2.6.5

brew install v8@3.15

gem install libv8 -v 3.16.14.19 -- --with-system-v8

gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15
@abournier

This comment has been minimized.

Copy link

@abournier abournier commented Dec 15, 2019

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Works perfectly for Catalina and Ruby 2.6.3. (after having testings many many things !) Thanks !

@ghost

This comment has been minimized.

Copy link

@ghost ghost commented Dec 17, 2019

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

@kennethkalmer you are the MAN!!!

@iTamilan

This comment has been minimized.

Copy link

@iTamilan iTamilan commented Dec 18, 2019

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

I tried every combination but this works perfectly. Thanks! @kennethkalmer

@kylebradshaw

This comment has been minimized.

Copy link

@kylebradshaw kylebradshaw commented Dec 19, 2019

^^^^^^^^^ thanks @iTamilan

@renny-ren

This comment has been minimized.

Copy link

@renny-ren renny-ren commented Dec 31, 2019

thanks @iTamilan

@wagnerpereira

This comment has been minimized.

Copy link

@wagnerpereira wagnerpereira commented Jan 3, 2020

If you need to do this with macOS 10.15 and ruby 2.3 here it is

brew install v8@3.15
gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8
gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/v8@3.15
bundle install

Confirmed Catalina 10.15.2!

@paulhklam1122

This comment has been minimized.

Copy link

@paulhklam1122 paulhklam1122 commented Jan 6, 2020

Happy to report that the following still works for ruby 2.7.0:

brew install v8@3.15

gem install libv8 -v 3.16.14.19 -- --with-system-v8

gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15
@ssjod

This comment has been minimized.

Copy link

@ssjod ssjod commented Jan 6, 2020

Using homebrew's directory of v8 for --with-v8-dir=/usr/local/Cellar/v8@3.15/3.15.11.18_1, instead of /usr/local/opt/v8-315, is what worked for me, in coding addicted's answer.

This is visible in the Summary of the brew install command, brew install v8-315.

@KiranJosh

This comment has been minimized.

Copy link

@KiranJosh KiranJosh commented Jan 8, 2020

gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

The therubyracer installation didnโ€™t for me, I still got this:

checking for v8.h... no

Here is what worked for me:

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

Good luck! ๐Ÿ™‚

It worked for me, thanks

@jkingsman

This comment has been minimized.

Copy link

@jkingsman jkingsman commented Jan 10, 2020

These steps did not work for me on Catalina using the system Ruby; I used ruby-2.6.3 via RVM and things worked.

@SeemabMehmood

This comment has been minimized.

Copy link

@SeemabMehmood SeemabMehmood commented Jan 14, 2020

$ bundle install

Awsome! Worked !

@barneyhsiao

This comment has been minimized.

Copy link

@barneyhsiao barneyhsiao commented Jan 17, 2020

If you need to do this with macOS 10.15 and ruby 2.3 here it is

brew install v8@3.15
gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8
gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/v8@3.15
bundle install

Worked beautifully for me. Thanks!

  • macOS Catalina 10.15.1
  • therubyracer (0.12.3)
  • libv8 (3.16.14.19 x86_64-linux)
  • rails (4.1.15)
  • bundler (1.16.2)
@thiagodsalles

This comment has been minimized.

Copy link

@thiagodsalles thiagodsalles commented Jan 24, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Perfect!

@karuppasamy

This comment has been minimized.

Copy link

@karuppasamy karuppasamy commented Jan 27, 2020

@thiagodsalles

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install
Perfect!

Worked perfectly.

  • bundler (1.17.2)
  • rails (4.2.11.1)
  • libv8 (3.15-3.15.11.18_1)
  • therubyracker (0.12.3)
  • macOS Catalina (10.15.2)
@AstmDesign

This comment has been minimized.

Copy link

@AstmDesign AstmDesign commented Feb 14, 2020

Hi @gurdiga, your solving is working well with me

My Mac OS is Mojave 10.14.4

Rails 5.1.1

Ruby 2.5.3

Was got the error checking for v8.h... no

and fixed it by using

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

thanks my bro

@aleks-rope

This comment has been minimized.

Copy link

@aleks-rope aleks-rope commented Feb 19, 2020

gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

Still works in 2020!

@arvinwiyono

This comment has been minimized.

Copy link

@arvinwiyono arvinwiyono commented Feb 20, 2020

Still works in macOS Catalina in 2020!

brew install v8-315
gem install libv8 -v '3.16.14.19' -- --with-system-v8
@sachinswagh

This comment has been minimized.

Copy link

@sachinswagh sachinswagh commented Feb 20, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

This worked for me . :)

@gyanpgupta

This comment has been minimized.

Copy link

@gyanpgupta gyanpgupta commented Feb 25, 2020

I did on Catalina...it is working for me

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

@ruvaleev

This comment has been minimized.

Copy link

@ruvaleev ruvaleev commented Mar 16, 2020

The therubyracer installation didnโ€™t for me, I still got this:

checking for v8.h... no

Here is what worked for me:

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

Good luck! ๐Ÿ™‚

Only this worked for me!

@chuyihuang

This comment has been minimized.

Copy link

@chuyihuang chuyihuang commented Mar 21, 2020

thank god it's still working March, 2020

@zhaoawd

This comment has been minimized.

Copy link

@zhaoawd zhaoawd commented Mar 21, 2020

I did on Catalina...it is working for me

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install
Only this worked for me on Catalina .

@jonathantsang

This comment has been minimized.

Copy link

@jonathantsang jonathantsang commented Mar 22, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

this worked ty.

@CatPerry

This comment has been minimized.

Copy link

@CatPerry CatPerry commented Mar 30, 2020

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

@kennethkalmer solution worked for me as well.

@jedidrew42

This comment has been minimized.

Copy link

@jedidrew42 jedidrew42 commented Mar 30, 2020

I am getting this error after following the Less installation on Mac running Catalina.

[WARNING] Please install gem 'therubyracer' to use Less.
Traceback (most recent call last):
15: from /usr/local/bin/lessc:23:in <main>' 14: from /usr/local/bin/lessc:23:in load'
13: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/bin/lessc:3:in <top (required)>' 12: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
11: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 10: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less.rb:9:in <top (required)>'
9: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less.rb:14:in <module:Less>' 8: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less.rb:14:in new'
7: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less/loader.rb:13:in initialize' 6: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less/java_script.rb:17:in context_wrapper'
5: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less/java_script.rb:9:in default_context_wrapper' 4: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require'
3: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' 2: from /Library/Ruby/Gems/2.6.0/gems/less-2.6.0/lib/less/java_script/v8_context.rb:2:in <top (required)>'
1: from /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require' /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in require': cannot load such file -- v8 (LoadError)

@jedidrew42

This comment has been minimized.

Copy link

@jedidrew42 jedidrew42 commented Mar 30, 2020

@CatPerry I tried to install using your methods but I am getting this message Could not locate Gemfile

@CatPerry

This comment has been minimized.

Copy link

@CatPerry CatPerry commented Mar 30, 2020

@CatPerry I tried to install using your methods but I am getting this message Could not locate Gemfile

@jedidrew42 try gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15 then try these steps. I wasnt installing or using Less, so this error isnt one that I ran into. Not sure beyond this^

@gamrom

This comment has been minimized.

Copy link

@gamrom gamrom commented Apr 1, 2020

The therubyracer installation didnโ€™t for me, I still got this:

checking for v8.h... no

Here is what worked for me:

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

Good luck! ๐Ÿ™‚

thankyou it really works for me!

@gulymaestro

This comment has been minimized.

Copy link

@gulymaestro gulymaestro commented Apr 3, 2020

Here is what worked for me:

gem install libv8 -v 'version' -- --with-system-v8
rvm autolibs disable
brew unlink v8
brew link v8@3.15 --force
gem install therubyracer -v 'version'
brew unlink v8@3.15
brew link v8
rvm autolibs enabled

Cheers!

@tomchapin

This comment has been minimized.

Copy link

@tomchapin tomchapin commented Apr 3, 2020

None of this helped me... no matter what I did, my gem install of therubyracer kept complaining with this error:

Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Beginning compilation. This will take some time.
Building v8 with env CXX=clang++ LINK=clang++  /usr/local/bin/gmake x64.release ARFLAGS.target=crs werror=no
GYP_GENERATORS=make \
build/gyp/gyp --generator-output="out" build/all.gyp \
              -Ibuild/standalone.gypi --depth=. \
              -Dv8_target_arch=x64 \
              -S.x64 -Dmac_deployment_target=10.15 -Dv8_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3 -Dwerror=''
  File "build/gyp/gyp", line 12
    except ImportError, e:
                      ^
SyntaxError: invalid syntax
gmake: *** [Makefile:268: out/Makefile.x64] Error 1

What ultimately helped me was this other forum I stumbled upon at https://www.bountysource.com/issues/82833405-libv8-fails-to-build-on-catalina-10-15

The final solution that worked for me:

I had to add these lines to my .zshrc file:

export CXX=clang++
export GYPFLAGS=-Dmac_deployment_target=10.15

Then I had to run these commands:

source ~/.zshrc
brew tap homebrew/homebrew-core
brew install v8@3.15
gem uninstall therubyracer
gem uninstall libv8
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8@3.15
bundle install

I hope someone else finds this useful!

@HuzaifaSaifuddin

This comment has been minimized.

Copy link

@HuzaifaSaifuddin HuzaifaSaifuddin commented Apr 5, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

This worked for me MacOS 10.15, Ruby 2.4.2. Thanks.

@amolpujari

This comment has been minimized.

Copy link

@amolpujari amolpujari commented Apr 8, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

@kennethkalmer thanks, worked for me too

@vvleon314

This comment has been minimized.

Copy link

@vvleon314 vvleon314 commented Apr 22, 2020

worked in 2020, April.
Thanks guys

@zainalmustofa

This comment has been minimized.

Copy link

@zainalmustofa zainalmustofa commented Apr 30, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

it work.. Thank you!!

@chaitanyamanyam

This comment has been minimized.

Copy link

@chaitanyamanyam chaitanyamanyam commented May 15, 2020

I did on Catalina...it is working for me

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

This worked. Thanks

@gizipp

This comment has been minimized.

Copy link

@gizipp gizipp commented May 18, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Works perfectly. Thanks.

@aleks-rdea

This comment has been minimized.

Copy link

@aleks-rdea aleks-rdea commented May 23, 2020

Cheers!!

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15
@nachoal

This comment has been minimized.

Copy link

@nachoal nachoal commented May 26, 2020

bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)

This one worked on Catalina 10.15.4

@klion26

This comment has been minimized.

Copy link

@klion26 klion26 commented May 27, 2020

tried all the above did not work for me(10.15.4 (19E287)),
worked for me after upgrade ruby to 2.7.1p83 by using brew install ruby and the previous solutions.

@jirihradil

This comment has been minimized.

Copy link

@jirihradil jirihradil commented May 28, 2020

This still works on Catalina 10.15.5 (ruby 2.4.4):

brew install v8@3.15
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8@3.15

Thanks!

@josephtyler

This comment has been minimized.

Copy link

@josephtyler josephtyler commented Jun 5, 2020

@bjoseru thanks, wroks for macOS 10.15 and ruby-2.6.5

brew install v8@3.15

gem install libv8 -v 3.16.14.19 -- --with-system-v8

gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

This appears to be the correct incantation, thank you.

@stkzk3110

This comment has been minimized.

Copy link

@stkzk3110 stkzk3110 commented Jun 6, 2020

This still works on Catalina 10.15.4 (ruby 2.3.0):

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

@kennethkalmer thanks!

@tomrossi7

This comment has been minimized.

Copy link

@tomrossi7 tomrossi7 commented Jun 17, 2020

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

Worked today on OSX 10.15.5 and Ruby 2.6.4

@amravazzi

This comment has been minimized.

Copy link

@amravazzi amravazzi commented Jun 17, 2020

This still works on Catalina 10.15.5 (ruby 2.4.4):

brew install v8@3.15
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8@3.15

Thanks!

Worked as June 2020, macOS Catalina!

@mantrala

This comment has been minimized.

Copy link

@mantrala mantrala commented Jun 22, 2020

This is what worked for me on Catalina

brew install v8@3.15
bundle config --local build.libv8 --with-system-v8
bundle config --local build.therubyracer --with-v8-dir=/usr/local/opt/v8@3.15
bundle install
@gyandeeps

This comment has been minimized.

Copy link

@gyandeeps gyandeeps commented Jun 22, 2020

It fails for me as i have tried all type of suggestions in this post.
Its able to find v8.h file but during its parsing has issues.

I get the same error as

Building native extensions with: '--with-v8-dir=/usr/local/opt/v8@3.15'
This could take a while...
ERROR:  Error installing therubyracer:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200622-88683-125x6b4.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
	--with-v8-dir
	--with-v8-include
	--without-v8-include=${v8-dir}/include
	--with-v8-lib
	--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version  (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with 
the libv8 rubygem. 

However, your system version of v8 could not be located. 

Please make sure your system version of v8 that is compatible 
with 3.16.14.19 installed. You may need to use the 
--with-v8-dir option if it is installed in a non-standard location
	from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
	from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/gem_make.out

Here is the error log:

nd_header: checking for v8.h... -------------------- no

"xcrun clang -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -I/usr/local/opt/v8@3.15/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -Wall -g -rdynamic  -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS  -arch x86_64  -c conftest.c"
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
In file included from conftest.c:3:
/usr/local/opt/v8@3.15/include/v8.h:98:1: error: unknown type name 'namespace'
namespace v8 {
^
/usr/local/opt/v8@3.15/include/v8.h:98:13: error: expected ';' after top level declarator
namespace v8 {
            ^
            ;
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <v8.h>
/* end */

More info:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
@catherynl

This comment has been minimized.

Copy link

@catherynl catherynl commented Jun 23, 2020

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

No idea what's happening but this totally worked for me (June 2020)!

@adilw3nomad

This comment has been minimized.

Copy link

@adilw3nomad adilw3nomad commented Jun 26, 2020

Yep this worked for me...

@rrobiso

This comment has been minimized.

Copy link

@rrobiso rrobiso commented Jun 26, 2020

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

No idea what's happening but this totally worked for me (June 2020)!

Absolutely! This worked for me too! June 2020

@weliame

This comment has been minimized.

Copy link

@weliame weliame commented Jun 30, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

This is awesome. It still works for me! Thanks so much.

@ajmaurya99

This comment has been minimized.

Copy link

@ajmaurya99 ajmaurya99 commented Jul 2, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Working for me for Catalina - July 2020

@dp21g

This comment has been minimized.

Copy link

@dp21g dp21g commented Jul 9, 2020

It fails for me as i have tried all type of suggestions in this post.
Its able to find v8.h file but during its parsing has issues.

I get the same error as

Building native extensions with: '--with-v8-dir=/usr/local/opt/v8@3.15'
This could take a while...
ERROR:  Error installing therubyracer:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200622-88683-125x6b4.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
	--with-v8-dir
	--with-v8-include
	--without-v8-include=${v8-dir}/include
	--with-v8-lib
	--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version  (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with 
the libv8 rubygem. 

However, your system version of v8 could not be located. 

Please make sure your system version of v8 that is compatible 
with 3.16.14.19 installed. You may need to use the 
--with-v8-dir option if it is installed in a non-standard location
	from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
	from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/gem_make.out

Here is the error log:

nd_header: checking for v8.h... -------------------- no

"xcrun clang -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -I/usr/local/opt/v8@3.15/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -Wall -g -rdynamic  -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS  -arch x86_64  -c conftest.c"
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
In file included from conftest.c:3:
/usr/local/opt/v8@3.15/include/v8.h:98:1: error: unknown type name 'namespace'
namespace v8 {
^
/usr/local/opt/v8@3.15/include/v8.h:98:13: error: expected ';' after top level declarator
namespace v8 {
            ^
            ;
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <v8.h>
/* end */

More info:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

mine was doing the same with some of the Cerner repos. My issue was my gem env was set to the system default location and I had recently installed rvm but not refreshed my terminal to pick up rvm as default ruby management of gems. Closing and opening terminal and testing gem env changed to correct locations seems to have done the trick.

@LucasKuhn

This comment has been minimized.

Copy link

@LucasKuhn LucasKuhn commented Jul 16, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked here as well. Thank you!

@ren6

This comment has been minimized.

Copy link

@ren6 ren6 commented Jul 17, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked here as well. Thank you!

Worked for me too.

@mirzalazuardi

This comment has been minimized.

Copy link

@mirzalazuardi mirzalazuardi commented Jul 29, 2020

Work like a charm. Great solution

@rebelcolony

This comment has been minimized.

Copy link

@rebelcolony rebelcolony commented Aug 11, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked here as well. Thank you!

Worked for me too.

Works for me Aug 2020 with ruby 2.7.1

@peterwillcn

This comment has been minimized.

Copy link

@peterwillcn peterwillcn commented Aug 11, 2020

$ brew install v8
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8)
$ bundle install

Great

@MadelineCollier

This comment has been minimized.

Copy link

@MadelineCollier MadelineCollier commented Aug 12, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

This^ worked great for me with Catalina 10.15.5, and ruby 2.5.7
Completely fixed the error pasted below for seo:

Installing libv8 3.16.14.19 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
Unable to find a compiler officially supported by v8.
An error occurred while installing libv8 (3.16.14.19), and Bundler cannot continue.
Make sure that `gem install libv8 -v '3.16.14.19' --source 'https://rubygems.org/'` succeeds before bundling.
@blakegearin

This comment has been minimized.

Copy link

@blakegearin blakegearin commented Aug 13, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked as well for Catalina 10.15.6 and ruby 2.7.0. Thanks!

@lonelyGhostisdog

This comment has been minimized.

Copy link

@lonelyGhostisdog lonelyGhostisdog commented Aug 17, 2020

It fails for me as i have tried all type of suggestions in this post.
Its able to find v8.h file but during its parsing has issues.

I get the same error as

Building native extensions with: '--with-v8-dir=/usr/local/opt/v8@3.15'
This could take a while...
ERROR:  Error installing therubyracer:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200622-88683-125x6b4.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
	--with-v8-dir
	--with-v8-include
	--without-v8-include=${v8-dir}/include
	--with-v8-lib
	--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version  (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with 
the libv8 rubygem. 

However, your system version of v8 could not be located. 

Please make sure your system version of v8 that is compatible 
with 3.16.14.19 installed. You may need to use the 
--with-v8-dir option if it is installed in a non-standard location
	from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
	from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/gem_make.out

Here is the error log:

nd_header: checking for v8.h... -------------------- no

"xcrun clang -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -I/usr/local/opt/v8@3.15/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -Wall -g -rdynamic  -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS  -arch x86_64  -c conftest.c"
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
In file included from conftest.c:3:
/usr/local/opt/v8@3.15/include/v8.h:98:1: error: unknown type name 'namespace'
namespace v8 {
^
/usr/local/opt/v8@3.15/include/v8.h:98:13: error: expected ';' after top level declarator
namespace v8 {
            ^
            ;
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <v8.h>
/* end */

More info:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I have the same error.
Have you solved this problem?

@cuong-dn

This comment has been minimized.

Copy link

@cuong-dn cuong-dn commented Aug 19, 2020

This is what worked for me on Catalina

brew install v8@3.15
bundle config --local build.libv8 --with-system-v8
bundle config --local build.therubyracer --with-v8-dir=/usr/local/opt/v8@3.15
bundle install

So many thanks!

@yingshin

This comment has been minimized.

Copy link

@yingshin yingshin commented Aug 27, 2020

It fails for me as i have tried all type of suggestions in this post.
Its able to find v8.h file but during its parsing has issues.
I get the same error as

Building native extensions with: '--with-v8-dir=/usr/local/opt/v8@3.15'
This could take a while...
ERROR:  Error installing therubyracer:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20200622-88683-125x6b4.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
	--with-v8-dir
	--with-v8-include
	--without-v8-include=${v8-dir}/include
	--with-v8-lib
	--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version  (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with 
the libv8 rubygem. 

However, your system version of v8 could not be located. 

Please make sure your system version of v8 that is compatible 
with 3.16.14.19 installed. You may need to use the 
--with-v8-dir option if it is installed in a non-standard location
	from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
	from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/gem_make.out

Here is the error log:

nd_header: checking for v8.h... -------------------- no

"xcrun clang -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -I/usr/local/opt/v8@3.15/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT   -Wall -g -rdynamic  -g -Os -pipe -DHAVE_GCC_ATOMIC_BUILTINS  -arch x86_64  -c conftest.c"
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
In file included from conftest.c:3:
/usr/local/opt/v8@3.15/include/v8.h:98:1: error: unknown type name 'namespace'
namespace v8 {
^
/usr/local/opt/v8@3.15/include/v8.h:98:13: error: expected ';' after top level declarator
namespace v8 {
            ^
            ;
2 errors generated.
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: #include <v8.h>
/* end */

More info:

gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.5.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

I have the same error.
Have you solved this problem?

After I tried the suggestions in this post, I update ruby version from 2.6.3 to 2.7.0, and problem solved.
Maybe some envs or files is missed, upgrade completely fixed it.

@rgavriel

This comment has been minimized.

Copy link

@rgavriel rgavriel commented Aug 31, 2020

Thanks a lot!!!
I wish I new this 3 hours ago!
๐Ÿค˜๐Ÿฝ

@azmatrana

This comment has been minimized.

Copy link

@azmatrana azmatrana commented Sep 1, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked here as well. Thank you!

Worked for me too.

Works for me Aug 2020 with ruby 2.7.1

Worked for me as well.
Catalina, ruby 2.6.3

@landovsky

This comment has been minimized.

Copy link

@landovsky landovsky commented Sep 4, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked for me, Catalina, Ruby 2.7.0. Thanks ๐Ÿ‘

@xjlin0

This comment has been minimized.

Copy link

@xjlin0 xjlin0 commented Sep 8, 2020

@kennethkalmer rocks! It still works for dinosaur versions (Ruby 2.1.2 by rvm reinstall 2.1.2 --with-openssl-dir=$HOME/.rvm/usr on Catalina), for my repo I also have to install nokogiri by NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri -v 'version_number_here'.

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install
@prashantomer

This comment has been minimized.

Copy link

@prashantomer prashantomer commented Sep 14, 2020

Here is what worked for me:

brew install v8@3.15
gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

@gurdiga this worked, thanks!

@rainb3rry

This comment has been minimized.

Copy link

@rainb3rry rainb3rry commented Sep 18, 2020

bundle install

Thank you

@artoodeeto

This comment has been minimized.

Copy link

@artoodeeto artoodeeto commented Oct 3, 2020

for others. if its throwing an error. Its maybe because your --with-v8-dir directory is different when brew installed it.

brew installed it in (macos catalina) /usr/local/Cellar/v8@3.15/3.15.11.18_1 so i have to change gem install therubyracer -- --with-v8-dir=/usr/local/Cellar/v8@3.15/3.15.11.18_1

@manikantapamarthi

This comment has been minimized.

Copy link

@manikantapamarthi manikantapamarthi commented Oct 19, 2020

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

This worked perfectly, thank you! ๐Ÿ™

@gouravnaik

This comment has been minimized.

Copy link

@gouravnaik gouravnaik commented Oct 27, 2020

Confirmed! Still works in Catalina, with small changes in version path, and without additional brew tap. Thanks! ๐Ÿ‘

Can you please help, my bundle is takin ages and sitting in below line
Installing libv8 6.7.288.46.1 with native extensions

M using catalina 10.15.6. and ruby 2.3.1.

Please help, Just shifted from ubuntu to mac, feeling real difficult

@yuri-karpovich

This comment has been minimized.

Copy link

@yuri-karpovich yuri-karpovich commented Nov 3, 2020

Confirmed! Still works in Catalina, with small changes in version path, and without additional brew tap. Thanks! ๐Ÿ‘

Can you please help, my bundle is takin ages and sitting in below line
Installing libv8 6.7.288.46.1 with native extensions

M using catalina 10.15.6. and ruby 2.3.1.

Please help, Just shifted from ubuntu to mac, feeling real difficult

Check one comment above!

@SeVEnMY

This comment has been minimized.

Copy link

@SeVEnMY SeVEnMY commented Nov 19, 2020

Still getting the error... Trying to install libv8 8.4.255.0 on OSX version Big Sur 11.0.1

@stormsilver

This comment has been minimized.

Copy link

@stormsilver stormsilver commented Nov 20, 2020

@GleidsonDaniel

This comment has been minimized.

Copy link

@GleidsonDaniel GleidsonDaniel commented Nov 27, 2020

@kennethkalmer rocks! It still works for dinosaur versions (Ruby 2.1.2 by rvm reinstall 2.1.2 --with-openssl-dir=$HOME/.rvm/usr on Catalina), for my repo I also have to install nokogiri by NOKOGIRI_USE_SYSTEM_LIBRARIES=1 gem install nokogiri -v 'version_number_here'.

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked on Big Sur, tks!

@f0ster

This comment has been minimized.

Copy link

@f0ster f0ster commented Dec 7, 2020

ty. ๐Ÿ™ Big Sur copypasta ready ๐Ÿ’…

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install
@loniecc

This comment has been minimized.

Copy link

@loniecc loniecc commented Dec 18, 2020

bundle install

save my hours

@eizengan

This comment has been minimized.

Copy link

@eizengan eizengan commented Dec 28, 2020

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

Worky on Big Sur 11.1 with Ruby 2.7.2 - thanks for the time save!

@oiahoon

This comment has been minimized.

Copy link

@oiahoon oiahoon commented Dec 30, 2020

good on, solved my issue in 2020 - Dec

@zahhar

This comment has been minimized.

Copy link

@zahhar zahhar commented Jan 13, 2021

Confirming โ€” steps described above by @eizengan work on BigSur 11.1

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Jan 18, 2021

Not Working on M1, BigSur 11.1...
:(

@santostiago

This comment has been minimized.

Copy link

@santostiago santostiago commented Jan 18, 2021

yeah.. it doesn't work on M1.

In file included from ../src/lazy-instance.h:94:
../src/once.h:115:7: error: no matching function for call to 'Acquire_Load'
  if (Acquire_Load(once) != ONCE_STATE_DONE) {
      ^~~~~~~~~~~~
../src/atomicops.h:125:10: note: candidate function not viable: no known conversion from 'v8::internal::OnceType *' (aka 'long *') to 'const volatile v8::internal::Atomic32 *' (aka 'const volatile int *') for 1st argument
Atomic32 Acquire_Load(volatile const Atomic32* ptr);
@jatindhankhar

This comment has been minimized.

Copy link

@jatindhankhar jatindhankhar commented Jan 21, 2021

For M1 macs try, appending with --with-cflags="-Wno-error=implicit-function-declaration"

Example

gem install libv8 -v '3.16.14.19' -- --with-system-v8 --with-cflags="-Wno-error=implicit-function-declaration"

Source: rbenv/ruby-build#1691 (comment)

@Dan2552

This comment has been minimized.

Copy link

@Dan2552 Dan2552 commented Jan 21, 2021

Also no luck on M1. Was able to use gem 'mini_racer', github: 'sqreen/mini_racer', branch: 'use-libv8-node' as a temporary workaround (though I probably wouldn't commit that in a real project, but it might get you running) see rubyjs/mini_racer#186

Also not directly relevant but for other M1 users I had some of these configs for other gems / other errors:

bundle config build.ffi --with-cflags=-Wno-error=implicit-function-declaration
bundle config build.puma --with-cflags=-Wno-error=implicit-function-declaration
bundle config build.libv8 --with-system-v8
bundle config build.sassc --disable-march-tune-native
@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Jan 23, 2021

Someone was able to run it on M1 ?

@sathish-kumar7

This comment has been minimized.

Copy link

@sathish-kumar7 sathish-kumar7 commented Jan 28, 2021

bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)

it works for me.. thanks

@shoerofi

This comment has been minimized.

Copy link

@shoerofi shoerofi commented Jan 30, 2021

ty. ๐Ÿ™ Big Sur copypasta ready ๐Ÿ’…

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

work on m1 MacBook Air Big Sur. thx

@Dan2552

This comment has been minimized.

Copy link

@Dan2552 Dan2552 commented Feb 1, 2021

Can confirm brew install v8@3.15 is now working on M1 where didn't previously

Edit: I was mistaken. Ignore this.

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Feb 1, 2021

When I run brew install v8@3.15 it gives me:

Error: v8@3.15: no bottle available!
You can try to install from source with:
  brew install --build-from-source v8@3.15
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

(in fact, v8@3.15 does not have any bottles for M1 -> https://formulae.brew.sh/formula/v8@3.15#default)

Also try to compile it with brew install --build-from-source v8@3.15 without luck

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Feb 2, 2021

Can confirm brew install v8@3.15 is now working on M1 where didn't previously

@Dan2552
Did you do something different this time ?

@Dan2552

This comment has been minimized.

Copy link

@Dan2552 Dan2552 commented Feb 2, 2021

๐Ÿคฏ ok now I'm confused as running brew list doesn't show it installed ๐Ÿคญ so I must have been mistaken

but the project I was trying to bundle did indeed bundle where it didn't before...
No idea if it's useful info or not, but in the project's Gemfile.lock I have libv8 (7.3.492.27.1)

I haven't actually ran the app, just know it bundled, so perhaps it bundled successfully just by having bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15) even though the directory /opt/homebrew/Cellar/v8@3.15/3.15.11.18_1 doesn't exist

Edit: ignore this.

Doesnโ€™t work. My personal suggestion is try for the meantime https://gist.github.com/fernandoaleman/868b64cd60ab2d51ab24e7bf384da1ca#gistcomment-3602043

Or try what eveevans suggests below

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Feb 2, 2021

Thats seems weird ... xD
:sigh:

I'll try a few more options. Thanks @Dan2552

@sathish-kumar7

This comment has been minimized.

Copy link

@sathish-kumar7 sathish-kumar7 commented Feb 3, 2021

When I run brew install v8@3.15 it gives me:

Error: v8@3.15: no bottle available!
You can try to install from source with:
  brew install --build-from-source v8@3.15
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other
official channels.

(in fact, v8@3.15 does not have any bottles for M1 -> https://formulae.brew.sh/formula/v8@3.15#default)

Also try to compile it with brew install --build-from-source v8@3.15 without luck

I have faced the same issue in high sierra. i updated my mac OS to Big Sur And it was resolved.

@lmrodriguezr

This comment has been minimized.

Copy link

@lmrodriguezr lmrodriguezr commented Feb 3, 2021

ty. ๐Ÿ™ Big Sur copypasta ready ๐Ÿ’…

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

Works perfectly in MacBook Pro 2020 running Catalina. Thanks!!!

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Feb 5, 2021

After days of dealing with this I finally found the solution.
First of all, there is no bottle for v8@3.15 for ARM yet.
So you have to install it via Rosseta 2.

This is the tricky part, because if you install brew, as the documentation, it will install the ARM version (for M1), but if you want to compile tools with Rosetta 2, you should have the Rosseta 2 version.
Then you will have 2 brews, one for ARM and one for Rosseta 2, this shoud does the trick, cause now with the Rosseta 2 version you could install v8@3.15

Install brew for ARM:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install brew for Intel (via Rosseta 2)
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Now I could use the ARM version as: brew
and the Rosseta 2 version as: arch -x86_64 /usr/local/homebrew/bin/brew

This is explained here: https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr

for the rest what I did was:
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.2' -- --with-v8-dir=/usr/local/Homebrew/opt/v8@3.15 (which is the path of v8 installed with Rosseta 2 brew)

@Dan2552

This comment has been minimized.

Copy link

@Dan2552 Dan2552 commented Feb 5, 2021

Wonโ€™t installing v8 via Rosetta also then require you compile and run Ruby itself in Rosetta too though? Compiling an ARM gem against an x86-64 compiled library definitely doesnโ€™t seem it would work

@blo0dshe3d

This comment has been minimized.

Copy link

@blo0dshe3d blo0dshe3d commented Feb 11, 2021

ty. ๐Ÿ™ Big Sur copypasta ready ๐Ÿ’…

brew install v8@3.15
bundle config build.libv8 --with-system-v8
bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
bundle install

also work with 2.4.6
many thanks

@ac-arecabay

This comment has been minimized.

Copy link

@ac-arecabay ac-arecabay commented Feb 18, 2021

from Big Sur.. many thanks :)

@beulahpt

This comment has been minimized.

Copy link

@beulahpt beulahpt commented Feb 20, 2021

I did on Catalina...it is working for me

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Thanks. Works for 2.7.1 too

@heaven

This comment has been minimized.

Copy link

@heaven heaven commented Feb 23, 2021

Thanks! ๐Ÿ‘

@rtoledo-dev-ao3

This comment has been minimized.

Copy link

@rtoledo-dev-ao3 rtoledo-dev-ao3 commented Feb 23, 2021

๐Ÿคฏ ok now I'm confused as running brew list doesn't show it installed ๐Ÿคญ so I must have been mistaken

but the project I was trying to bundle did indeed bundle where it didn't before...
No idea if it's useful info or not, but in the project's Gemfile.lock I have libv8 (7.3.492.27.1)

I haven't actually ran the app, just know it bundled, so perhaps it bundled successfully just by having bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15) even though the directory /opt/homebrew/Cellar/v8@3.15/3.15.11.18_1 doesn't exist

Isn't working for me: big sur m1....

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Feb 24, 2021

๐Ÿคฏ ok now I'm confused as running brew list doesn't show it installed ๐Ÿคญ so I must have been mistaken
but the project I was trying to bundle did indeed bundle where it didn't before...
No idea if it's useful info or not, but in the project's Gemfile.lock I have libv8 (7.3.492.27.1)
I haven't actually ran the app, just know it bundled, so perhaps it bundled successfully just by having bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15) even though the directory /opt/homebrew/Cellar/v8@3.15/3.15.11.18_1 doesn't exist

Isn't working for me: big sur m1....

@rtoledo-dev What issue do you have ?

@Dan2552

This comment has been minimized.

Copy link

@Dan2552 Dan2552 commented Feb 24, 2021

@eveevans

This comment has been minimized.

Copy link

@eveevans eveevans commented Feb 25, 2021

Just to clarify.
In order to use v8@3.15, I have to install brew for x86, and Ruby for x86 via ASDF.

i.e.
arch -x86_64 asdf install ruby 2.7.2

I also had some issues installing it with readline, and with some gems like Nokogiri, Thin, MySQL, etc, in all cases, I just have to pass some flags, to find dependencies from x86 brew.

For V8 I used:

gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.2' -- --with-v8-dir=/usr/local/Homebrew/opt/v8@3.15

@saviono

This comment has been minimized.

Copy link

@saviono saviono commented Mar 10, 2021

Here is what worked for me:

gem install libv8 -v 'version' -- --with-system-v8
rvm autolibs disable
brew link v8@3.15 --force
gem install therubyracer -v 'version'
brew unlink v8@3.15
rvm autolibs enabled

Cheers!

Worked for me !

@redebron20

This comment has been minimized.

Copy link

@redebron20 redebron20 commented Mar 25, 2021

For bundler I did the following on Catalina

$ brew install v8@3.15
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix v8@3.15)
$ bundle install

Worked for big sur 11.2.3!

@enowmbi

This comment has been minimized.

Copy link

@enowmbi enowmbi commented Mar 27, 2021

gem install therubyracer -- --with-v8-dir=/usr/local/opt/v8@3.15

works. great.

@KyleAsaff

This comment has been minimized.

Copy link

@KyleAsaff KyleAsaff commented Mar 31, 2021

I am able to install therubyracer using the help from this thread but when I start my server I get:

17:58:09 web.1  | started with pid 70200
17:58:10 web.1  | [70200] Puma starting in cluster mode...
17:58:10 web.1  | [70200] * Version 4.3.6 (ruby 2.6.6-p146), codename: Mysterious Traveller
17:58:10 web.1  | [70200] * Min threads: 5, max threads: 5
17:58:10 web.1  | [70200] * Environment: development
17:58:10 web.1  | [70200] * Process workers: 3
17:58:10 web.1  | [70200] * Preloading application
17:58:13 web.1  | dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
17:58:13 web.1  |   Referenced from: /Users/kyle/.rvm/gems/ruby-2.6.6/gems/therubyracer-0.12.3/lib/v8/init.bundle
17:58:13 web.1  |   Expected in: flat namespace
17:58:13 web.1  | 
17:58:13 web.1  | dyld: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
17:58:13 web.1  |   Referenced from: /Users/kyle/.rvm/gems/ruby-2.6.6/gems/therubyracer-0.12.3/lib/v8/init.bundle
17:58:13 web.1  |   Expected in: flat namespace
17:58:13 web.1  | 
17:58:13 web.1  | terminated by SIGIOT
17:58:13 system | sending SIGTERM to all processes

anyone know how to fix this?

@electricfeel1979

This comment has been minimized.

Copy link

@electricfeel1979 electricfeel1979 commented Apr 8, 2021

After days of dealing with this I finally found the solution.
First of all, there is no bottle for v8@3.15 for ARM yet.
So you have to install it via Rosseta 2.

This is the tricky part, because if you install brew, as the documentation, it will install the ARM version (for M1), but if you want to compile tools with Rosetta 2, you should have the Rosseta 2 version.
Then you will have 2 brews, one for ARM and one for Rosseta 2, this shoud does the trick, cause now with the Rosseta 2 version you could install v8@3.15

Install brew for ARM:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install brew for Intel (via Rosseta 2)
arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"

Now I could use the ARM version as: brew
and the Rosseta 2 version as: arch -x86_64 /usr/local/homebrew/bin/brew

This is explained here: https://stackoverflow.com/questions/64963370/error-cannot-install-in-homebrew-on-arm-processor-in-intel-default-prefix-usr

for the rest what I did was:
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.2' -- --with-v8-dir=/usr/local/Homebrew/opt/v8@3.15 (which is the path of v8 installed with Rosseta 2 brew)

This one solve the issue for me. I am using an m1 as well and using rbenv instead since I was having issue using rvm to install version 2.6.5.

So for me:

gem install libv8 -v '3.16.14.19' -- --with-system-v8 --with-cflags="-Wno-error=implicit-function-declaration"
arch -x86_64 /usr/local/homebrew/bin/brew install v8@3.15
echo 'export PATH="/usr/local/homebrew/opt/v8@3.15/bin:$PATH"' >> ~/.zshrc
gem install libv8 -v '3.16.14.19' -- --with-system-v8
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/Homebrew/opt/v8@3.15
bundle install

After that bundle install went successful. Hope this helps :D

These were the issues I was having:

An error occurred while installing therubyracer (0.12.3), and Bundler
cannot continue.
Make sure that gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/' succeeds before bundling.

`configure': By using --with-system-v8, you have chosen to use the version
(Libv8::Location::System::NotFoundError)
of V8 found on your system and not the one that is bundled with
the libv8 rubygem.

However, your system version of v8 could not be located.

Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from

brew install v8@3.15
Error: v8@3.15: no bottle available!
You can try to install from source with:
brew install --build-from-source v8@3.15
Please note building from source is unsupported. You will encounter build
failures with some formulae. If you experience any issues please create pull
requests instead of asking for help on Homebrew's GitHub, Twitter or any other

@electricfeel1979

This comment has been minimized.

Copy link

@electricfeel1979 electricfeel1979 commented Apr 9, 2021

I am able to install therubyracer using the help from this thread but when I start my server I get:

17:58:09 web.1  | started with pid 70200
17:58:10 web.1  | [70200] Puma starting in cluster mode...
17:58:10 web.1  | [70200] * Version 4.3.6 (ruby 2.6.6-p146), codename: Mysterious Traveller
17:58:10 web.1  | [70200] * Min threads: 5, max threads: 5
17:58:10 web.1  | [70200] * Environment: development
17:58:10 web.1  | [70200] * Process workers: 3
17:58:10 web.1  | [70200] * Preloading application
17:58:13 web.1  | dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
17:58:13 web.1  |   Referenced from: /Users/kyle/.rvm/gems/ruby-2.6.6/gems/therubyracer-0.12.3/lib/v8/init.bundle
17:58:13 web.1  |   Expected in: flat namespace
17:58:13 web.1  | 
17:58:13 web.1  | dyld: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
17:58:13 web.1  |   Referenced from: /Users/kyle/.rvm/gems/ruby-2.6.6/gems/therubyracer-0.12.3/lib/v8/init.bundle
17:58:13 web.1  |   Expected in: flat namespace
17:58:13 web.1  | 
17:58:13 web.1  | terminated by SIGIOT
17:58:13 system | sending SIGTERM to all processes

anyone know how to fix this?

@KyleAsaff were you able to solve this? I am having a similar issue

dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
  Referenced from: /Users/kevin/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/therubyracer-0.12.3/lib/v8/init.bundle
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
  Referenced from: /Users/kevin/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/therubyracer-0.12.3/lib/v8/init.bundle
  Expected in: flat namespace

zsh: abort      rails s -- --with-v8-dir=/usr/local/Homebrew/opt/v8@3.15
@KyleAsaff

This comment has been minimized.

Copy link

@KyleAsaff KyleAsaff commented Apr 9, 2021

@electricfeel1979 I haven't been able to find a solution and I am unable to develop until I do so. please let me know if you come across any solutions!

@electricfeel1979

This comment has been minimized.

Copy link

@electricfeel1979 electricfeel1979 commented Apr 9, 2021

@electricfeel1979 I haven't been able to find a solution and I am unable to develop until I do so. please let me know if you come across any solutions!

@KyleAsaff
Well right now I have a success with this, moment as I am writing this. I am already over that issue with therubyracer and its running perfectly now.

This was my guide:
https://www.driftingruby.com/episodes/a-rubyist-s-apple-m1-review

I changed the version of my ruby from 2.6.5 to 2.7.2 as well, but I think changing the version didnt help with this, since before I redo everything I was already using 2.7.2 and still having that therubyracer issue.

I removed entirere rbenv. And very carefully followed the instructions from the above link. Basically its all setting up stuffs with the arch -x86_64 rosetta stuffs. You will have to follow carefully and adjust since that video and instructions are kinda not so updated anymore.

@oguzcicek

This comment has been minimized.

Copy link

@oguzcicek oguzcicek commented Apr 19, 2021

@electricfeel1979 I haven't been able to find a solution and I am unable to develop until I do so. please let me know if you come across any solutions!

same issue.. Have you found any solution ?

@Leenday

This comment has been minimized.

Copy link

@Leenday Leenday commented Apr 20, 2021

So i met this issue while building docker images.
Solution for me was:

  1. Add to docker-compose.yml under the image name:
image_name:
      platform: linux/x86_64
      ...
  1. Add to Dockerfile before RUN bundle install
RUN gem install libv8 -v '3.16.14.13' -- --with-system-v8
RUN gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8@3.15

@dasarikarthik81

This comment has been minimized.

Copy link

@dasarikarthik81 dasarikarthik81 commented Apr 23, 2021

Followed most of the solution in the conversation.
gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8@3.15
Always errors out with

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /Users/username/.gemexport/gems/therubyracer-0.12.3/ext/v8

/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r ./siteconf20210423-85748-hgkoyn.rb extconf.rb --with-v8-dir=/usr/local/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.

Provided configuration options:
--with-opt-dir
--without-opt-dir
--with-opt-include
--without-opt-include=${opt-dir}/include
--with-opt-lib
--without-opt-lib=${opt-dir}/lib
--with-make-prog
--without-make-prog
--srcdir=.
--curdir
--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
--with-pthreadlib
--without-pthreadlib
--with-objclib
--without-objclib
--enable-debug
--disable-debug
--with-v8-dir
--with-v8-include
--without-v8-include=${v8-dir}/include
--with-v8-lib
--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version (Libv8::Location::System::NotFoundError)
of V8 found on your system and not the one that is bundled with
the libv8 rubygem.

However, your system version of v8 could not be located.

Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in configure_makefile' from extconf.rb:32:in

'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

/Users/username/.gemexport/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/username/.gemexport/gems/therubyracer-0.12.3 for inspection.
Results logged to /Users/username/.gemexport/extensions/universal-darwin-19/2.6.0/therubyracer-0.12.3/gem_make.out

An error occurred while installing therubyracer (0.12.3), and Bundler cannot continue.
Make sure that gem install therubyracer -v '0.12.3' --source 'https://company.net/api/gems/rubygems/' succeeds before bundling.

@polonski

This comment has been minimized.

Copy link

@polonski polonski commented Apr 25, 2021

the only thing that worked for me was - Big Sur 11.2.3

gem uninstall libv8
gem install therubyracer -v '0.12.3' -- --with-v8-dir="/usr/local/opt/v8@3.15" --with-cflags="-Wno-error=implicit-function-declaration"

key was not having v8 installed before installing therubyracer

@tiagogeraldi

This comment has been minimized.

Copy link

@tiagogeraldi tiagogeraldi commented Apr 28, 2021

I found a solution installing a second Homebrew x86, with the alias ibrew.

arch -x86_64 /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
alias ibrew='arch -x86_64 /usr/local/bin/brew'
ibrew install v8@3.15
gem install therubyracer -v 0.12.3 -- --with-v8-dir=/usr/local/opt/v8@3.15

Got the idea from: https://soffes.blog/homebrew-on-apple-silicon

Updated:
I still had issues with therubyracer, it would be necessary install ruby on x84 either.
So, I ended up just replacing it by mini_racer

@KyleAsaff

This comment has been minimized.

Copy link

@KyleAsaff KyleAsaff commented Apr 28, 2021

ive tried everything in this thread since my last comment... still having this issue:

~/work/rails-project โœ—                                                                                                                                                  28d4h โš‘ โ—’  
โ–ถ gem install libv8 -v '3.16.14.13' -- --with-system-v8
Fetching libv8-3.16.14.13.gem
Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.13
Parsing documentation for libv8-3.16.14.13
Installing ri documentation for libv8-3.16.14.13
Done installing documentation for libv8 after 0 seconds
1 gem installed

~/work/rails-project โœ—                                                                                                                                                  28d4h โš‘ โ—’  
โ–ถ gem install therubyracer -v '0.12.3' -- --with-v8-dir=/usr/local/opt/v8@3.15
Building native extensions with: '--with-v8-dir=/usr/local/opt/v8@3.15'
This could take a while...
Successfully installed therubyracer-0.12.3
Parsing documentation for therubyracer-0.12.3
Done installing documentation for therubyracer after 0 seconds
1 gem installed

~/work/rails-project โœ—                                                                                                                                                  28d4h โš‘ โ—’  
โ–ถ rails s
dyld: lazy symbol binding failed: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
  Referenced from: /Users/kyleasaff/.rvm/gems/ruby-2.7.2/gems/therubyracer-0.12.3/lib/v8/init.bundle
  Expected in: flat namespace

dyld: Symbol not found: __ZN2v82V821AddGCPrologueCallbackEPFvNS_6GCTypeENS_15GCCallbackFlagsEES1_
  Referenced from: /Users/kyleasaff/.rvm/gems/ruby-2.7.2/gems/therubyracer-0.12.3/lib/v8/init.bundle
  Expected in: flat namespace

[1]    7473 abort      rails s

anyone have any ideas at all? I can successfully install therubyracer but it throws an error when I start my rails server. I am not using docker, I am just trying to run it locally on my machine.

@alwinaugustin

This comment has been minimized.

Copy link

@alwinaugustin alwinaugustin commented Apr 30, 2021

None of this is working for me. It is giving me the error as follows:

Installing therubyracer 0.12.3 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3/ext/v8
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/ruby -I
/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0 -r
./siteconf20210430-34242-1i9kf2u.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--without-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
	--with-v8-dir
	--with-v8-include
	--without-v8-include=${v8-dir}/include
	--with-v8-lib
	--without-v8-lib=${v8-dir}/lib
/Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using
--with-system-v8, you have chosen to use the version  (Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.

However, your system version of v8 could not be located.

Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
	from /Library/Ruby/Gems/2.6.0/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
	from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.6.0/gems/therubyracer-0.12.3 for inspection.
Results logged to
/Library/Ruby/Gems/2.6.0/extensions/universal-darwin-20/2.6.0/therubyracer-0.12.3/gem_make.out

An error occurred while installing therubyracer (0.12.3), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/'` succeeds
before bundling.

I am trying this on a Mac machine with BigSur 11.2.3 is installed and the Ruby version is ruby 2.6.3p62 (2019-04-16 revision 67580) [universal.x86_64-darwin20] and Gem is of version 3.0.3.

@VishalAher0108

This comment has been minimized.

Copy link

@VishalAher0108 VishalAher0108 commented Apr 30, 2021

Hello friend,

I used the above-mentioned process many times but every time it failed.
Ruby version = 2.4.1
Rails version = 5.2.1

I am trying this on a Mac machine with BigSur.

Whenever I execute the bundle, get the following result.

current directory: /Users/vishalaher/.rvm/gems/ruby-2.4.1@ro-ec/gems/therubyracer-0.12.3/ext/v8
/Users/vishalaher/.rvm/rubies/ruby-2.4.1/bin/ruby -I /Users/vishalaher/.rvm/rubies/ruby-2.4.1/lib/ruby/site_ruby/2.4.0 -r ./siteconf20210430-86341-cpasqo.rb extconf.rb
--with-v8-dir\=/opt/homebrew/opt/v8@3.15
checking for -lpthread... yes
checking for -lobjc... yes
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers.  Check the mkmf.log file for more details.  You may
need configuration options.

Provided configuration options:
	--with-opt-dir
	--with-opt-include
	--without-opt-include=${opt-dir}/include
	--with-opt-lib
	--without-opt-lib=${opt-dir}/lib
	--with-make-prog
	--without-make-prog
	--srcdir=.
	--curdir
	--ruby=/Users/vishalaher/.rvm/rubies/ruby-2.4.1/bin/$(RUBY_BASE_NAME)
	--with-pthreadlib
	--without-pthreadlib
	--with-objclib
	--without-objclib
	--enable-debug
	--disable-debug
	--with-v8-dir
	--with-v8-include
	--without-v8-include=${v8-dir}/include
	--with-v8-lib
	--without-v8-lib=${v8-dir}/lib
/Users/vishalaher/.rvm/gems/ruby-2.4.1@ro-ec/gems/libv8-3.16.14.19/ext/libv8/location.rb:50:in `configure': By using --with-system-v8, you have chosen to use the version
(Libv8::Location::System::NotFoundError)
of V8 found on your system and *not* the one that is bundled with
the libv8 rubygem.

However, your system version of v8 could not be located.

Please make sure your system version of v8 that is compatible
with 3.16.14.19 installed. You may need to use the
--with-v8-dir option if it is installed in a non-standard location
	from /Users/vishalaher/.rvm/gems/ruby-2.4.1@ro-ec/gems/libv8-3.16.14.19/lib/libv8.rb:7:in `configure_makefile'
	from extconf.rb:32:in `<main>'

To see why this extension failed to compile, please check the mkmf.log which can be found here:

  /Users/vishalaher/.rvm/gems/ruby-2.4.1@ro-ec/extensions/-darwin-20/2.4.0/therubyracer-0.12.3/mkmf.log

extconf failed, exit code 1

Gem files will remain installed in /Users/vishalaher/.rvm/gems/ruby-2.4.1@ro-ec/gems/therubyracer-0.12.3 for inspection.
Results logged to /Users/vishalaher/.rvm/gems/ruby-2.4.1@ro-ec/extensions/-darwin-20/2.4.0/therubyracer-0.12.3/gem_make.out

An error occurred while installing therubyracer (0.12.3), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/'` succeeds before bundling.

In Gemfile:
  therubyracer

thank you in advance.

@fabiensebban

This comment has been minimized.

Copy link

@fabiensebban fabiensebban commented May 7, 2021

Hello everybody !
I had the same problem using ruby version 2.5.1. I tried everything above but nothing worked.
Then I just change to ruby version 2.7.2 and I can bundle install all dependencies (including libv8).

@pdkproitf

This comment has been minimized.

Copy link

@pdkproitf pdkproitf commented May 13, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment