osx yosemite上的gem install therubyracer -v'0.12.0'无效

时间:2015-01-27 14:22:35

标签: ruby-on-rails ruby macos

嗨,这是我的控制台日志,

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

    /Users/user/.rvm/rubies/ruby-1.9.3-p448/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes 
checking for v8.h... no 
*** extconf.rb failed *** 
Could not create Makefile due to some reason, probably lack of 
necessary libraries and/or headers.  Check the mkmf.log file for more 
details.  You may need configuration options. 

Provided configuration options: 
    --with-opt-dir 
    --with-opt-include 
--without-opt-include=${opt-dir}/include 
--with-opt-lib 
--without-opt-lib=${opt-dir}/lib 
--with-make-prog 
--without-make-prog 
--srcdir=. 
--curdir 
--ruby=/Users/user/.rvm/rubies/ruby-1.9.3-p448/bin/ruby 
--with-pthreadlib 
--without-pthreadlib 
--with-objclib 
--without-objclib 
--enable-debug 
--disable-debug 
--with-v8-dir 
--without-v8-dir 
--with-v8-include 
--without-v8-include=${v8-dir}/include 
--with-v8-lib 
--without-v8-lib=${v8-dir}/ 
/Users/user/.rvm/gems/ruby-1.9.3-p448@projVer2.3/gems/libv8-3.16.14.3/ext/libv8    /location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError) 
and *not* the one that is bundle with the libv8 rubygem. However, 
it could not be located. please make sure you have a version of 
v8 that is compatible with 3.16.14.3 installed. You may 
need to special --with-v8-dir options if it is in a non-standard 
location 

thanks, 
The Mgmt 

from /Users/user/.rvm/gems/ruby-1.9.3-p448@projVer2.3/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile' 
from extconf.rb:32:in `<main>' 


Gem files will remain installed in /Users/user/.rvm/gems/ruby-1.9.3-p448@projVer2.3/gems/therubyracer-0.12.1 for inspection. 
Results logged to /Users/user/.rvm/gems/ruby-1.9.3-p448@projVer2.3/gems/therubyracer-    0.12.1/ext/v8/gem_make.out 
FDLMC060:helpkit user$  

我尝试了很多通过自制软件安装libv8然后尝试安装therubyracer但没有帮助的链接。

我也试过这个链接..

How to install therubyracer gem on 10.10 Yosemite?

但在安装v8时会抛出错误。

交换机--with-system-v8安装libv8 但它没有安装therubyracer -v&#39; 0.12.0&#39;

OS - &gt; OS X Yosemite

安装了apple-gcc 4.2

并在CC,CXX上进行了导出

请帮我解决这个问题。

2 个答案:

答案 0 :(得分:1)

尝试

gem install therubyracer -v '0.12.0' -- --with-v8-dir=/path/to/v8

但在你的系统上安装v8之前

答案 1 :(得分:0)

感谢@Stanislav试图帮助我。

我终于完成了这件事,

使用安装了所有与libv8相关的宝石     &#34; gem uninstall libv8 -a -x&#34; 然后使用&#34; rm -rf Gemfile.lock&#34;删除Gemfile.lock; 并尝试过     &#34;捆绑安装&#34; 它工作!!!!