如何在 10.10 Yosemite 上安装 therubyracer gem? [英] How to install therubyracer gem on 10.10 Yosemite?

查看:14
本文介绍了如何在 10.10 Yosemite 上安装 therubyracer gem?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在 Yosemite 10.10 上安装 therubyracer gem.

这是日志:

<上一页>11:53 $ gem install libv8 -v '3.16.14.3' -- --with-system-v8使用以下命令构建本机扩展:'--with-system-v8'这可能需要一段时间...成功安装 libv8-3.16.14.3解析 libv8-3.16.14.3 的文档为 libv8-3.16.14.3 安装 ri 文档0 秒后完成为 libv8 安装文档已安装 1 个宝石02:05 $ gem install therubyracer -v '0.12.1' -- --with-system-v8使用以下命令构建本机扩展:'--with-system-v8'这可能需要一段时间...错误:安装 ruby​​racer 时出错:错误:无法构建 gem 原生扩展./usr/local/var/rbenv/versions/2.1.2/bin/ruby extconf.rb --with-system-v8检查 -lpthread 中的 main() ... 是检查 -lobjc 中的 main()... 是检查 v8.h ... 否*** extconf.rb 失败 ***由于某种原因无法创建 Makefile,可能缺乏必要库和/或标题.检查 mkmf.log 文件以获取更多详细信息.您可以需要配置选项.提供的配置选项:--with-opt-dir--without-opt-dir--with-opt-include--without-opt-include=${opt-dir}/include--with-opt-lib--without-opt-lib=${opt-dir}/lib--with-make-prog--没有-make-prog--srcdir=.--curdir--ruby=/usr/local/var/rbenv/versions/2.1.2/bin/ruby--with-pthreadlib--没有-pthreadlib--with-objclib--没有-objclib--启用调试--禁用调试--with-v8-dir--没有-v8-dir--with-v8-include--without-v8-include=${v8-dir}/include--with-v8-lib--without-v8-lib=${v8-dir}/lib/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': 你有选择使用在您的系统上找到的 V8 版本 (Libv8::Location::System::NotFoundError)并且*不是*与 libv8 ruby​​gem 捆绑在一起的那个.然而,无法找到它.请确保你有一个版本安装了与 3.16.14.3 兼容的 v8.您可以如果它在非标准中,则需要特殊的 --with-v8-dir 选项地点谢谢,管理来自/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'来自 extconf.rb:32:in `'extconf 失败,退出代码 1Gem 文件将继续安装在/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1 以供检查.结果记录到/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make.出去

解决方案

git clone https://github.com/cowboyd/libv8.git光盘 libv8捆绑安装bundle exec rake clean build 二进制文件gem install pkg/libv8-3.16.14.3-x86_64-darwin-12.gem #注意libv8版本可能会改变,所以在pkg/中的文件中使用tab,还记得使用指定版本的那个

然后只需捆绑您的项目 gems

这是它在 10.10 (ruby 2.1.2) 上对我有用的唯一方法

I don't manage to install therubyracer gem on Yosemite 10.10.

Here is the log:

11:53  $ gem install libv8 -v '3.16.14.3' -- --with-system-v8


Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.3
Parsing documentation for libv8-3.16.14.3
Installing ri documentation for libv8-3.16.14.3
Done installing documentation for libv8 after 0 seconds
1 gem installed


02:05  $ gem install therubyracer -v '0.12.1' -- --with-system-v8


Building native extensions with: '--with-system-v8'
This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

    /usr/local/var/rbenv/versions/2.1.2/bin/ruby extconf.rb --with-system-v8
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
    --without-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=/usr/local/var/rbenv/versions/2.1.2/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}/lib
/usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/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 /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/libv8-3.16.14.3/lib/libv8.rb:7:in `configure_makefile'
    from extconf.rb:32:in `'

extconf failed, exit code 1

Gem files will remain installed in /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to /usr/local/var/rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-14/2.1.0-static/therubyracer-0.12.1/gem_make.out

解决方案

git clone https://github.com/cowboyd/libv8.git
cd libv8
bundle install
bundle exec rake clean build binary
gem install pkg/libv8-3.16.14.3-x86_64-darwin-12.gem #note that libv8 version may change, so tab through files in pkg/, also remember to use the one with version specified

then just bundle your project gems

this is the only way it worked for me on 10.10 (ruby 2.1.2)

这篇关于如何在 10.10 Yosemite 上安装 therubyracer gem?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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