2015-04-06 132 views
0

我升級軌到4.2.0和紅寶石2.2.1。首先我升級了導軌,一切都很好。當我將ruby版本升級到2.2.1並運行bundle install時,它給了我以下錯誤。Gem :: Ext :: BuildError:錯誤:無法構建gem原生擴展。 GCC錯誤

Gem::Ext::BuildError: ERROR: Failed to build gem native extension. 

    /Users/ps032791/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150406-64754-18zessv.rb extconf.rb 
creating Makefile 
Compiling v8 for x64 
Using python 2.7.5 
Configured with: --prefix=/Library/Developer/CommandLineTools/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=/Library/Developer/CommandLineTools/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/ps032791/.rvm/gems/[email protected]/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/ps032791/.rvm/gems/[email protected]/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/ps032791/.rvm/gems/[email protected]/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/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `each' 
    from /Users/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `verify_installation!' 
    from /Users/ps032791/.rvm/gems/[email protected]/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/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o 
    CXX(target) /Users/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o 
    CXX(target) /Users/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o 
    CXX(target) /Users/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o 
    CXX(target) /Users/ps032791/.rvm/gems/[email protected]/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/ps032791/.rvm/gems/[email protected]/gems/libv8-3.11.8.17 for inspection. 
Results logged to /Users/ps032791/.rvm/gems/[email protected]/extensions/x86_64-darwin-14/2.2.0-static/libv8-3.11.8.17/gem_make.out 
An error occurred while installing libv8 (3.11.8.17), and Bundler cannot continue. 
Make sure that `gem install libv8 -v '3.11.8.17'` succeeds before bundling. 

另外gem install libv8 -v '3.11.8.17'也因相同的錯誤而失敗。

有沒有人得到類似的錯誤?你能請指導我如何解決這個問題?

回答

3

試試這個:

$ brew install v8 

然後:
$ gem install libv8 -v '3.16.14.3' -- --with-system-v8

然後捆綁安裝。
祝你好運。

+0

這兩個命令均已成功。但是再次運行'bundle install',給出了同樣的舊錯誤。 – user3438489

+0

這很奇怪,如果兩個命令都成功了,那應該沒問題,對不起,這對我很有用。 –

+0

FWIW:這對我有用。 –

相關問題