Difficulty installing therubyracer 0.10.2 and apple-gcc42 on Mac OSX 10.12.6 Sierra

纵饮孤独 提交于 2019-12-08 03:12:14

问题


The answer to this similar question doesn't solve my problem. Here is the answer from that question:

If you decide to use a newer therubyracer gem version, you will no longer have this problem

Otherwise:

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

The problem I'm running into with this solution is with apple-gcc42. When I run this line:

brew install apple-gcc42

I get the following error:

apple-gcc42: This formula either does not compile or function as expected on macOS
versions newer than Mavericks due to an upstream incompatibility.

If I ignore that error and try to gem install therubyracer -v '0.10.2' anyway, I get this:

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

I've tried many other solutions, such as the other answers to the linked question, but most of them rely on apple-gcc42.


回答1:


Why did you uninstall libv8? The error line in your output:

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'

sounds like libv8 is missing. Try installing that? It seems to be looking for libv8-3.3.10.4, so maybe you have to specify the version?

Side note: V8 3.3.10.4 is from 2011, and not even the latest patch of the 3.3 branch, so it is pretty much guaranteed to be full of bugs that were discovered and fixed later, which may well be security relevant. Do not run untrusted code in there!



来源:https://stackoverflow.com/questions/46104063/difficulty-installing-therubyracer-0-10-2-and-apple-gcc42-on-mac-osx-10-12-6-sie

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!