簡體   English   中英

無法在OS X Mavericks中安裝gem'therubyracer'

[英]Cannot install gem 'therubyracer' in OS X Mavericks

我是mac的新手,並嘗試bundle install克隆的rails repo。 我在安裝libv8 gem時遇到了錯誤,谷歌搜索並找到了解決方案

brew install libv8
gem install libv8 -- --with-system-v8

接下來我得到了明智的寶石,完整的痕跡如下

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

    /Users/anand/.rvm/rubies/ruby-2.0.0-p247/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.5
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
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make[1]: *** [/Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/libpreparser_lib.a] Error 1
make: *** [x64.release] Error 2
/Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '/Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/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/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `each'
    from /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/ext/libv8/location.rb:35:in `verify_installation!'
    from /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/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_enable_backtrace=1 -Dv8_can_use_vfp2_instructions=true -Darm_fpu=vfpv2 -Dv8_can_use_vfp3_instructions=true -Darm_fpu=vfpv3
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum-dtoa.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/cached-powers.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/conversions.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/diy-fp.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/dtoa.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/fast-dtoa.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/fixed-dtoa.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/once.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/preparse-data.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/preparser.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/preparser-api.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/scanner.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/strtod.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/token.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/unicode.o
  CXX(target) /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/obj.target/preparser_lib/src/utils.o
  LIBTOOL-STATIC /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/vendor/v8/out/x64.release/libpreparser_lib.a


Gem files will remain installed in /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3 for inspection.
Results logged to /Users/anand/.rvm/gems/ruby-2.0.0-p247/gems/libv8-3.16.14.3/ext/libv8/gem_make.out

我認為這是小牛隊的一個問題。

您可能想嘗試我在這個問題中總結的內容: osx mavericks上沒有安裝的“gem install therubyracer -v'0.10.2”

brew install apple-gcc42

sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2 /usr/bin/gcc 
sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2 /usr/bin/g++ 
sudo ln -s /usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2 /usr/bin/cpp

brew uninstall v8 (only in case you installed it with brew)
gem install libv8
gem install therubyracer

讓我知道這個是否奏效! 自從小牛隊推出以來,我一直在處理同樣的問題:)

對不起,我不知道是什么解決了我的問題。 我正在嘗試一切,並得到修復。

我使用macports安裝了gcc47,而不是自制軟件。(在我的慢速512kbps連接中安裝需要將近2天)

然后我將therubyracer的版本改為'0.12.0'

我不知道哪個問題得到解決。

現在安裝v8后嘗試重新安裝ruby。

rvm reinstall 2.0

然后安裝有gem install therubyracer

當我從OSX Mountain Lion升級到OSX Mavericks時,我遇到了同樣的問題。

從ruby-1.8.7-p354升級到ruby-1.8.7-375對我來說是個竅門。 也許將你的ruby 2.0.0-p125升級到2.0.0-rc2(2.0已高於p353)

如果你使用rbenv:

rbenv install 2.0.0-rc2
rbenv rehash
rbenv shell 2

bundle install
gem uninstall libv8
brew rm v8
brew tap homebrew/dupes
brew install apple-gcc42
brew tap homebrew/versions
brew install v8-315
brew link --force v8-315
gem install libv8 -- --with-system-v8
gem install therubyracer

感謝DeLaGuardo

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM