在Mac OSX 10.12.6 Sierra上难以安装therubyracer 0.10.2和apple-gcc42 [英] Difficulty installing therubyracer 0.10.2 and apple-gcc42 on Mac OSX 10.12.6 Sierra

查看:116
本文介绍了在Mac OSX 10.12.6 Sierra上难以安装therubyracer 0.10.2和apple-gcc42的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

的答案问题不能解决我的问题.这是该问题的答案:

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

如果您决定使用较新的therubyracer gem版本,则不会 再有这个问题

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

否则:

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.当我运行此行时:

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

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',我会得到:

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

我尝试了许多其他解决方案,例如链接问题的其他答案,但其中大多数依赖apple-gcc42.

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

推荐答案

为什么要卸载libv8?输出中的错误行:

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'

缺少libv8之类的声音.尝试安装吗?似乎正在寻找libv8-3.3.10.4,所以也许您必须指定版本?

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?

侧面说明:V8 3.3.10.4是2011年发行的,甚至不是3.3分支的最新补丁,因此可以保证它充满了以后发现并修复的bug,这很可能与安全性有关.不要在其中运行不受信任的代码!

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!

这篇关于在Mac OSX 10.12.6 Sierra上难以安装therubyracer 0.10.2和apple-gcc42的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆