Closed ahuigo closed 7 months ago
Related issue: https://github.com/rubyjs/therubyracer/issues/455 This error relates the command :
"xcrun clang -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/universal-darwin19 -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0/ruby/backward -I/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/include/ruby-2.6.0 -I. -I/usr/local/opt/v8@3.15/include -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'
Getting the same error and nothing is helping. Tried the method that involves the --with-v8-dir=/usr/local/opt/v8@3.15 flag and I'm still getting the same message.
Also set the following options in my .zshrc file export CXX=clang++ export GYPFLAGS=-Dmac_deployment_target=10.15
Ok fixed it by installing both v8 & theruby racer with bundler and instead of running bundle config build.libv8 --with-system-v8
which is what every instruction here told me, I ran bundle config build.libv8 --with-cxx=clang++
So the full ~/.bundle/config is
---
BUNDLE_BUILD__LIBV8: "--with-cxx=clang++"
BUNDLE_BUILD__THERUBYRACER: "--with-v8-dir=/usr/local/opt/v8@3.15"
You can also maybe add --with-v8-include and --with-v8-lib options to the 2nd line which is what I also had but I don't think those are necessary.
Sorry but this gem is unmaintained, so I will close this issue.
We recommend going with mini_racer + libv8-node. If you feel the issue is still relevant to either of those, please open an issue over there!
I failed to install therubyracer. My env is:
Here is output: