Ответ на этот похожий вопрос не решает мою проблему. Вот ответ на этот вопрос:
Если вы решите использовать новую версию gem-версии therubyracer, вы не будете дольше эта проблема
В противном случае:
brew tap homebrew/dupes # Thanks Tom brew install apple-gcc42 export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2 brew uninstall v8 gem uninstall libv8 gem install therubyracer -v '0.10.2' # specify version
Проблема, с которой я сталкиваюсь с этим решением, - apple-gcc42. Когда я запустил эту строку:
brew install apple-gcc42
Я получаю следующую ошибку:
apple-gcc42: This formula either does not compile or function as expected on macOS
versions newer than Mavericks due to an upstream incompatibility.
Если я проигнорирую эту ошибку и попробую gem install therubyracer -v '0.10.2'
, я получаю следующее:
current directory: /Users/wylliam/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.2/ext/v8
/Users/wylliam/.rbenv/versions/1.9.3-p551/bin/ruby -r ./siteconf20170907-76249-1po4ii1.rb extconf.rb
checking for main() in -lobjc... yes
creating Makefile
current directory: /Users/wylliam/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.2/ext/v8
make clean
current directory: /Users/wylliam/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/therubyracer-0.10.2/ext/v8
make
compiling rr.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
1 warning generated.
compiling v8.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_array.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_callbacks.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_context.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_date.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_debug.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_exception.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
v8_exception.cpp:10:16: warning: unused variable 'stack' [-Wunused-variable]
static void* stack[20];
^
1 warning generated.
compiling v8_external.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable]
VALUE references;
^
1 warning generated.
compiling v8_function.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_handle.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_locker.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
v8_locker.cpp:45:5: warning: control reaches end of non-void function [-Wreturn-type]
}
^
v8_locker.cpp:85:5: warning: control reaches end of non-void function [-Wreturn-type]
}
^
2 warnings generated.
compiling v8_message.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_object.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
v8_object.cpp:77:19: warning: unused variable 'proto' [-Wunused-variable]
Handle<Value> proto(rr_rb2v8(prototype));
^
1 warning generated.
compiling v8_script.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_string.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_template.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_try_catch.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_v8.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
compiling v8_value.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
v8_value.cpp:100:9: warning: unused function 'ToInt32' [-Wunused-function]
VALUE ToInt32(VALUE self) {
^
1 warning generated.
compiling v8_weakref.cpp
clang: warning: argument unused during compilation: '-rdynamic' [-Wunused-command-line-argument]
linking shared-object v8.bundle
clang: error: no such file or directory: '/Users/wylliam/.rbenv/versions/1.9.3-p551/lib/ruby/gems/1.9.1/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a'
make: *** [v8.bundle] Error 1
make failed, exit code 2
Я пробовал много других решений, таких как другие ответы на связанный вопрос, но большинство из них полагаются на apple-gcc42.