在OS X 10.10上gem install therubyracer -v 0.11.4失败 [英] gem install therubyracer -v 0.11.4 fails on OS X 10.10

查看:94
本文介绍了在OS X 10.10上gem install therubyracer -v 0.11.4失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

按照此处的步骤上,我能够将therubyracer -v 0.10.2和0.12.0安装得很好,但无法安装0.11.4.

Following the steps here "gem install therubyracer -v '0.10.2'" on osx mavericks not installing, I was able to get therubyracer -v 0.10.2 and 0.12.0 to install fine, but not 0.11.4.

gem install therubyracer -v 0.11.4

返回:

Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

    /Users/thooper/.rbenv/versions/2.1.2/bin/ruby -r ./siteconf20150102-7132-9ct9a4.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.9
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);
                 ^
1 error generated.
make[1]: *** [/Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o] Error 1
make: *** [x64.release] Error 2
/Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/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/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `each'
    from /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `verify_installation!'
    from /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:26:in `install!'
    from extconf.rb:7:in `<main>'
GYP_GENERATORS=make \
    build/gyp/gyp --generator-output="out" build/all.gyp \
                  -Ibuild/standalone.gypi --depth=. \
                  -Dv8_target_arch=x64 \
                  -S.x64  -Dv8_can_use_vfp_instructions=true
  CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
  CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
  CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target) /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o

extconf failed, exit code 1

Gem files will remain installed in /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.11.8.17 for inspection.
Results logged to /Users/thooper/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/libv8-3.11.8.17/gem_make.out

推荐答案

我终于有了therubyracer 0.11.4,可以使用Xcode 6.1.1、6.2 beta或6.3 beta(我已经测试了全部3个)以及Xcode进行安装和使用4.6.3(位于: https://developer.apple.com/downloads/index.action ),然后运行:

I finally got therubyracer 0.11.4 to install and working using Xcode 6.1.1, 6.2 beta or 6.3 beta (I've tested all 3) and also Xcode 4.6.3 (available at: https://developer.apple.com/downloads/index.action) then running:

# rename your current version of Xcode to make it distinguishable
sudo mv /Applications/Xcode.app /Applications/$(xcodebuild -version | head -1 | sed -e 's/ //').app

# Download and install Xcode 4.6.3 and run:
sudo mv /Applications/Xcode.app /Applications/Xcode4.6.3.app

# Switch to your 4.6.3 version of Xcode
sudo xcode-select --switch /Applications/Xcode4.6.3.app

# Install the version of libv8 that's tied to your version of TRR:
gem install libv8 -v '3.11.8.17'

# Switch back to you original version of Xcode
sudo xcode-select --switch /Applications/Xcode6.x.app

# Install TRR
gem install therubyracer -v '0.11.4'

这篇关于在OS X 10.10上gem install therubyracer -v 0.11.4失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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