user@me-MacBook-Pro jekyll-site % sudo bundle exec jekyll serve
Could not find therubyracer-0.12.3 in any of the sources
Run `bundle install` to install missing gems.
现在我跑bundle install
了,它一直在运行,直到Installing therubyracer 0.12.3 with native extensions
. 在这一步,它会抛出一个错误:
/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.
并且,
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.
然后按照这里的建议,我运行了以下命令:
gem install therubyracer -v '0.12.3' --source 'https://rubygems.org/'
它给出了另一个错误,它说:
Using compiler: c++ (clang version 12.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/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/libv8-3.16.14.19/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
clang: warning: include path for libstdc++ 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 error generated.
make[1]: *** [/Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.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
/Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.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 '/Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.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 /Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `each'
from /Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/libv8-3.16.14.19/ext/libv8/location.rb:35:in `verify_installation!'
from /Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/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/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/gems/libv8-3.16.14.19 for inspection.
Results logged to /Users/me/.rbenv/versions/2.5.1/lib/ruby/gems/2.5.0/extensions/x86_64-darwin-20/2.5.0/libv8-3.16.14.19/gem_make.out
我该如何解决这个问题并在本地机器上运行 Jekyll?