【问题标题】:gem install therubyracer -v '0.12.0' on osx yosemite not workinggem install therubyracer -v '0.12.0' 在 osx yosemite 上不工作
【发布时间】:2015-03-26 04:50:43
【问题描述】:

您好,这是我的控制台日志,

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 '0.12.0'

操作系统 -> OS X Yosemite

安装了apple-gcc 4.2

并在 CC、CXX 上导出

请帮我解决这个问题。

【问题讨论】:

    标签: ruby-on-rails ruby macos


    【解决方案1】:

    尝试

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

    但在您应该在系统上安装 v8 之前

    【讨论】:

    • 我试过这个..但没有帮助..我安装了带有 --with-system-v8 选项的 libv8,并将 libv8 gem 的位置指定为 --with-v8-dir= /Users/user/.rvm/gems/ruby-1.9.3-p448@projVer2.3/gems/libv8-3.16.14.3/
    【解决方案2】:

    感谢@Stanislav 试图帮助我。

    我终于做到了,

    使用卸载所有与 libv8 相关的 gem “宝石卸载 libv8 -a -x” 然后使用“rm -rf Gemfile.lock”删除 Gemfile.lock 并尝试过 “捆绑安装” 成功了!!!!

    【讨论】:

    • 恭喜 :) 一些奇怪的错误,但它现在可以工作真是太好了
    猜你喜欢
    • 2020-10-06
    • 2023-04-09
    • 2020-05-06
    • 1970-01-01
    • 2015-03-01
    • 1970-01-01
    • 2014-07-27
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多