我正在尝试在 cataline os 上安装 therubyracer gem,但似乎没有什么对我有用。我已经尝试了stackoverflow答案上可用的每一个命令。
以下是我得到的错误 -
gem install therubyracer -- --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...
ERROR: Error installing therubyracer:
ERROR: Failed to build gem native extension.
current directory: /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/ext/libv8
/Users/pusingh/.rvm/rubies/ruby-2.4.7/bin/ruby -I /Users/pusingh/.rvm/rubies/ruby-2.4.7/lib/ruby/site_ruby/2.4.0 -r ./siteconf20200221-44280-1so4i7j.rb extconf.rb --with-v8-dir\=/usr/local/opt/v8@3.15
creating Makefile
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/disable-building-tests.patch
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/disable-werror-on-osx.patch
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/disable-xcode-debugging.patch
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/do-not-imply-vfp3-and-armv7.patch
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/do-not-use-MAP_NORESERVE-on-freebsd.patch
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/do-not-use-vfp2.patch
Applying /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/patches/fPIC-for-static.patch
Compiling v8 for x64
Using python 2.7.16
Using compiler: c++ (clang version 11.0.0)
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) /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/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]: *** [/Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/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
/Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/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 '/Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/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 /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `each'
from /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19/ext/libv8/location.rb:26:in `install!'
from extconf.rb:7:in `<main>'
extconf failed, exit code 1
Gem files will remain installed in /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/gems/libv8-3.16.14.19 for inspection.
Results logged to /Users/pusingh/.rvm/gems/ruby-2.4.7@itildesk/extensions/x86_64-darwin-19/2.4.0/libv8-3.16.14.19/gem_make.out
我最近运行的一些命令是 - gcc -dumpversion (9.2.0)、gem uninstall libv8、gem uninstall v8、gem install libv8 -v '3.16.14.19' -- --with-system-v8、gem install therubyracer - v '0.11.3', gem install therubyracer -v '0.11.3' -- --with-v8-dir=/usr/local/opt/v8@3.15 bundle install 请大家帮忙