Gem 安装 therubyracer -v '0.11.4'?

2024-01-20

我几乎要疯狂地安装红宝石赛车手。我知道有很多人和我有同样的问题,我也看过这些问题,但对我来说太复杂了,因为不同的情况有不同的解决方案。而事实上,一直没有很好的办法来解决这个问题。我的问题类似于this https://github.com/cowboyd/therubyracer/issues/288,并且有一个讨论 https://github.com/cowboyd/libv8/pull/124对此,目前还没有定论。

尽管有这些,this https://stackoverflow.com/questions/22481435/fix-therubyracer-libv8-0-12-1-installation-on-mavericks是一个很好的问题Chris S,但是却没有一个好的结果。

① 以下是关于我的问题的一些说明:

1.ruby 2.2.1p85(2015-02-26修订版49769)[x86_64-darwin15]

2.libv8 3.11.8.17 具有本机扩展

② OS X El Capitan,10.11

③ 错误信息如下:

ERROR:  Error installing therubyracer:
ERROR: Failed to build gem native extension.

/Users/hufeipeng/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20151026-41811-14t2l9a.rb extconf.rb

checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
creating Makefile

make "DESTDIR=" clean

make "DESTDIR="
compiling accessor.cc
clang: warning: argument unused during compilation: '-rdynamic'
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:353:33: error: use of undeclared identifier 'nullptr'
V8_INLINE MaybeLocal() : val_(nullptr) {}
                            ^
/usr/local/include/v8.h:360:51: error: use of undeclared identifier 'nullptr'
V8_INLINE bool IsEmpty() const { return val_ == nullptr; }
                                              ^
/usr/local/include/v8.h:364:29: error: use of undeclared identifier 'nullptr'
out->val_ = IsEmpty() ? nullptr : this->val_;
                        ^
/usr/local/include/v8.h:430:50: error: use of undeclared identifier 'nullptr'
bool IsFirstPass() const { return callback_ != nullptr; }
                                             ^
/usr/local/include/v8.h:790:42: error: use of undeclared identifier 'nullptr'
V8_INLINE Global() : PersistentBase<T>(nullptr) {}
                                     ^
/usr/local/include/v8.h:815:18: error: use of undeclared identifier 'nullptr'
other.val_ = nullptr;
             ^
/usr/local/include/v8.h:827:18: error: use of undeclared identifier 'nullptr'
rhs.val_ = nullptr;
             ^
/usr/local/include/v8.h:1092:52: error: use of undeclared identifier 'nullptr'
ScriptOrigin* origin = nullptr));
                         ^
/usr/local/include/v8config.h:347:48: note: expanded from macro 'V8_DEPRECATE_SOON'
#define V8_DEPRECATE_SOON(message, declarator) declarator
                                           ^
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:1095:30: error: use of undeclared identifier 'nullptr'
ScriptOrigin* origin = nullptr);
                         ^
/usr/local/include/v8.h:2283:42: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
kNormalString = static_cast<int>(v8::NewStringType::kNormal),
                                     ^
/usr/local/include/v8.h:2284:48: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
kInternalizedString = static_cast<int>(v8::NewStringType::kInternalized)
                                           ^
/usr/local/include/v8.h:3205:36: error: use of undeclared identifier 'nullptr'
return NewInstance(context, 0, nullptr);
                               ^
/usr/local/include/v8.h:3434:38: error: 'v8::ArrayBufferCreationMode' is not a class, namespace, or scoped enumeration
ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
                                 ^
/usr/local/include/v8.h:3797:38: error: 'v8::ArrayBufferCreationMode' is not a class, namespace, or scoped enumeration
ArrayBufferCreationMode mode = ArrayBufferCreationMode::kExternalized);
                                 ^
/usr/local/include/v8.h:4457:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                             ^
/usr/local/include/v8.h:4485:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                             ^
/usr/local/include/v8.h:7151:27: error: use of undeclared identifier 'nullptr'
if (V8_UNLIKELY(val_ == nullptr)) V8::ToLocalEmpty();
                        ^
/usr/local/include/v8config.h:353:54: note: expanded from macro 'V8_UNLIKELY'
# define V8_UNLIKELY(condition) (__builtin_expect(!!(condition), 0))
                                                 ^
In file included from accessor.cc:1:
In file included from ./rr.h:4:
/usr/local/include/v8.h:7596:46: error: 'v8::NewStringType' is not a class, namespace, or scoped enumeration
Set(v8::String::NewFromUtf8(isolate, name, NewStringType::kNormal)
                                         ^
In file included from accessor.cc:1:
./rr.h:358:39: error: no member named 'ScriptData' in namespace 'v8'
class ScriptData : public Pointer<v8::ScriptData> {
                              ~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [accessor.o] Error 1

make failed, exit code 2

Gem files will remain installed in
/Users/*/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/therubyracer-0.11.4 for inspection.
Results logged to
/Users/*/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/extensions/x86_64-darwin-15/2.2.0-static/therubyracer-0.11.4/gem_make.out

Help!



好吧,首先我很抱歉再次重新编辑问题,太忙没有时间注意到你们为我回复的评论。而且,在这里,我非常感谢 @Javid Jamae 为我提供了解决问题的好方法,尽管还有一些小问题需要处理,但没关系,我们只需要错误来帮助我们找到问题所在最终答案。以下是我尝试@Javid Jamae 方式后的控制台,

首先我还没有安装gcc with brew之前,所以我用brew安装的,版本是最新的5.2.0 (/usr/local/Cellar/gcc/5.2.0)。详细信息如下:

➜  /Users/xxx  >brew install gcc
==> Installing dependencies for gcc: gmp, mpfr, libmpc, isl
==> Installing gcc dependency: gmp
==> Downloading https://homebrew.bintray.com/bottles/gmp-6.0.0a.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring gmp-6.0.0a.el_capitan.bottle.tar.gz
????  /usr/local/Cellar/gmp/6.0.0a: 15 files, 3.2M
==> Installing gcc dependency: mpfr
==> Downloading https://homebrew.bintray.com/bottles/mpfr-3.1.3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring mpfr-3.1.3.el_capitan.bottle.tar.gz
????  /usr/local/Cellar/mpfr/3.1.3: 24 files, 3.6M
==> Installing gcc dependency: libmpc
==> Downloading https://homebrew.bintray.com/bottles/libmpc-1.0.3.el_capitan.bottle.tar.gz
######################################################################## 100.0%
==> Pouring libmpc-1.0.3.el_capitan.bottle.tar.gz
????  /usr/local/Cellar/libmpc/1.0.3: 10 files, 380K
==> Installing gcc dependency: isl
==> Downloading https://homebrew.bintray.com/bottles/isl-0.14.1.el_capitan.bottle.3.tar.gz
######################################################################## 100.0%
==> Pouring isl-0.14.1.el_capitan.bottle.3.tar.gz
????  /usr/local/Cellar/isl/0.14.1: 68 files, 3.2M
==> Installing gcc
==> Downloading https://homebrew.bintray.com/bottles/gcc-5.2.0.el_capitan.bottle.2.tar.gz
##################### 29.8%
curl: (56) SSLRead() return error -9806
Error: Failed to download resource "gcc"
Download failed: https://homebrew.bintray.com/bottles/gcc-5.2.0.el_capitan.bottle.2.tar.gz
Warning: Bottle installation failed: building from source.
==> Downloading http://ftpmirror.gnu.org/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
==> Downloading from http://mirrors.ustc.edu.cn/gnu/gcc/gcc-5.2.0/gcc-5.2.0.tar.bz2
######################################################################## 100.0%
==> Patching
patching file gcc/jit/Make-lang.in
patching file gcc/jit/jit-playback.c
Hunk #1 succeeded at 2459 with fuzz 2 (offset 43 lines).
==> ../configure --build=x86_64-apple-darwin15.0.0 --prefix=/usr/local/Cellar/gcc/5.2.0 --libdir=/usr/local/Cel
==> make bootstrap
==> make install
==> Caveats
GCC has been built with multilib support. Notably, OpenMP may not work:
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=60670
If you need OpenMP support you may want to brew reinstall gcc --without-multilib
==> Summary
????  /usr/local/Cellar/gcc/5.2.0: 1353 files, 248M, built in 52.4 minutes

看来安装没问题!然后,我卸载了红宝石赛车手 and libv8与宝石。然而,当涉及到安装时红宝石赛车手(我在安装或安装时没有指出版本Gemfile,以及bundle提醒我版本0.12.2是需要的),出现错误:

➜  /Users/xxx/Documents/workspace/xxx git:(master) ✗ >gem install therubyracer -v '0.12.2'
Fetching: libv8-3.16.14.13.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
ERROR: Failed to build gem native extension.
/Users/xxx/.rbenv/versions/2.2.1/bin/ruby -r ./siteconf20151230-50968-1yqguip.rb extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.10
Using compiler: /usr/bin/c++ (clang version 6.1.0)
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool: file:
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o has no symbols
In file included from ../src/accessors.cc:28:
In file included from ../src/v8.h:60:
In file included from ../src/objects-inl.h:38:
In file included from ../src/elements.h:33:
In file included from ../src/heap.h:35:
In file included from ../src/incremental-marking.h:33:
In file included from ../src/mark-compact.h:32:
../src/spaces.h:896:26: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to true [-Werror,-Wtautological-undefined-compare]
bool exists() { return this != NULL && code_range_ != NULL; }
                     ^~~~    ~~~~
../src/spaces.h:898:9: error: 'this' pointer cannot be null in well-defined C++ code; comparison may be assumed to always evaluate to false [-Werror,-Wtautological-undefined-compare]
if (this == NULL || code_range_ == NULL) return false;
    ^~~~    ~~~~
2 errors generated.
make[1]: ***
[/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/v8_base/src/accessors.o]
Error 1
make: *** [x64.release] Error 2
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive '
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/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/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:35:in `each'
from
/Uses/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/ext/libv8/location.rb:35:in `verify_installation!'
from
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/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 -Dwerror=''
CXX(target)
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/allocation.o
CXX(target)
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/atomicops_internals_x86_gcc.o
CXX(target)
/Users/xxx/.rbenv/versions/2.2.1/lib/ruby/gems/2.2.0/gems/libv8-3.16.14.13/vendor/v8/out/x64.release/obj.target/preparser_lib/src/bignum.o
.................. (the follow error messages are similar to above)

嗯,我想知道这仍然是问题libv8!一开始我觉得可能是版本的问题红宝石赛车手,所以我尝试安装该版本0.12.0,不幸的是,也有同样的错误。有一些奇怪的东西,我的意思是libv8安装有红宝石赛车手就我而言(请从错误消息中查看),但你与我不同。正如您的建议所标记的那样,您安装了libv8安装后红宝石赛车手,为什么它们不同?也许和我有关ruby环境设置,这里我发布了我的Gemfile配置:

gem 'rails', '4.1.6'
gem 'mysql2', '0.3.18'
gem 'sass-rails', '~> 4.0.3'
gem 'bootstrap-sass', '~> 3.3.4'
gem 'uglifier', '>= 1.3.0'
gem 'coffee-rails', '~> 4.0.0'

gem 'therubyracer', platforms: :ruby

gem 'jquery-rails','3.1.2'
gem 'jquery-ui-rails', '4.0.5'
gem 'turbolinks'
gem 'jbuilder', '~> 2.0'
gem 'sdoc', '~> 0.4.0', group: :doc

gem 'log4r', '1.1.9'
gem 'devise','3.4.1'
gem 'carrierwave', '0.10.0'
gem 'mini_magick', '3.6.0'
gem 'thin','1.6.2'
gem 'kaminari', '0.16.1'
gem 'factory_girl_rails'
gem 'httparty'
gem "select2-rails",'3.5.9.3'

group :test, :development do
    gem 'net-ssh', '2.7.0'
    gem 'capistrano', '2.12.0'
    gem 'capistrano-rbenv', '1.0.1'
    gem 'spring'
    gem 'magic_encoding', '0.0.2'
    gem 'rspec-rails', '3.2.0'
end

这对我有用:

$ brew upgrade gcc

$ gem uninstall therubyracer

$ gem uninstall libv8

$ gem install therubyracer -v '0.12.0'
Fetching: therubyracer-0.12.0.gem (100%)
Building native extensions.  This could take a while...
Successfully installed therubyracer-0.12.0
1 gem installed

$ gem install libv8 -v '3.16.14.3' -- --with-system-v8
Fetching: libv8-3.16.14.3.gem (100%)
Building native extensions with: '--with-system-v8'
This could take a while...
Successfully installed libv8-3.16.14.3
1 gem installed

参考:

  • https://github.com/cowboyd/therubyracer/issues/398 https://github.com/cowboyd/therubyracer/issues/398
  • https://github.com/cowboyd/therubyracer/issues/288#issuecomment-63923606 https://github.com/cowboyd/therubyracer/issues/288#issuecomment-63923606
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

Gem 安装 therubyracer -v '0.11.4'? 的相关文章

随机推荐

  • 使用 AES 加密文件、使用 RSA 加密密钥 - 我走在正确的轨道上吗?

    概述 我正在尝试设计一个应用程序来加密文件以安全地发送蜗牛邮件 大量数据 我计划使用 Net 中的 AES RijndaelManaged 加密来最初加密文件 使用随机生成的密钥RNGCryptoServiceProvider 然后我使用
  • 使用特定队列调用dispatch_async时的符号断点

    我正在调试项目中涉及中央调度的问题 在调试过程中 如果有一种在工作被分派到特定队列时收到通知的方法 将会非常有帮助 有没有办法设置符号断点dispatch async有一个条件可以检查调度队列参数是否与我有权访问的其他队列相同 以下是设置条
  • 在类库(.NET 标准)中找不到位图类

    我想制作一个类库 NET Standard 并且我正在使用 System Drawing 但我收到错误 CS0246 C 找不到类型或命名空间名称 Bitmap 您是否缺少 using 指令或程序集引用 我正在使用 NET Standard
  • 函数计算已在真/假表达式中使用,该表达式用作表过滤表达式,这是不允许的

    我需要检查 ssas 表格模型中某个度量的当月和当年值 但由于类型不匹配 我无法执行此操作 为此 我创建了一个使用此 dax 查询的度量 CurrMonthYear CONCATENATE CONCATENATE concatenate y
  • 设置表格单元格内容的最大高度

    我有一张桌子 它应该始终占据屏幕高度的一定百分比 大多数行的高度都是固定的 但我有一行应该拉伸以填充可用空间 如果该行中单元格的内容溢出所需的高度 我希望使用溢出 隐藏来剪辑内容 不幸的是 表和行不遵守 max height 属性 这是 W
  • 从 A-Z 排序 div

    我有一个聊天网页 每个成员都有一个 DIV DIV 的外观如下 div div class chatmember 10001 div div class chatmember 10008 div div class chatmember 1
  • scipy 中的 kmeans 和 kmeans2 有什么区别?

    我是机器学习的新手 想知道 scipy 中 kmeans 和 kmeans2 之间的区别 根据文档 它们都使用 k means 算法 但是如何选择它们呢 根据文档 kmeans2 似乎是标准的 k 均值算法 并且运行直到收敛到局部最优 并且
  • SQL SELECT * FROM XXX WHERE 数组中的列名

    我正在编写一些 SQL 代码 我熟悉语法 SELECT FROM myTable WHERE myColumn in 1 2 3 假设我正在编写一些 C 代码 我想在其中使用我使用过的 C 数组 1 2 3 我怎么做 您可以动态构建 SQL
  • 当活动被破坏时,GPS图标不会消失吗?

    作为一个尝试 GPS 东西的 Android 新手 我设法将这段代码组合在一起 它的工作原理就像我期望的那样 除了一件事 GPS 图标永远不会消失 如何让GPS图标在Activity被破坏时消失 我有 locationManager rem
  • 在 Ruby 中如何找到机器上的空闲物理内存?

    我想知道系统上有多少可用物理内存 不包括任何交换区 有没有办法在 Ruby 中获取这些信息 如果您使用 Linux 您通常使用 free 命令来查找系统上的物理内存 即 RAM 详细信息 output x free 输出将类似于以下字符串
  • 如何使用 boto3 仅检索 S3 中的 last_modified 密钥

    我只想使用 boto3 从 S3 存储桶中检索特定前缀中的 last modified 密钥 Get Today s date today datetime date today Get Objects date s3 boto3 reso
  • Angular8 i18n 用于占位符标签文本

    如何在 ngx mat select search palceholderLabel 中添加 i18n div class form group col md 6 mb lg 5 mb 4 div
  • 确保 MongoDb findAndModify 中独占读取的方法?

    我有一个 MongoDB 集合 用作作业队列 多个进程从中读取记录 使用findAndModify FindAndModify搜索记录 其中activefield 为 false 将其设置为 true 这样其他进程就不会读取同一条记录 问题
  • Excel Range 中的一维数组

    我目前正在使用以下代码填充我的数组 Securities Option Base 1 Securities Array Worksheets 3 Range A8 A SymbolCount Value 这会生成一个二维数组 其中每个地址都
  • 如何解释生成对抗网络中判别器的损失和生成器的损失?

    我正在阅读人们对 DCGAN 的实现 尤其是this one https github com carpedm20 DCGAN tensorflow在张量流中 在该实现中 作者画出了判别器和生成器的损失 如下所示 图片来自https git
  • Azure Web 作业 - 如何连接到 Azure MS SQL 数据库?

    我有一个发布到 Azure 的 MVC 网站 它使用 Azure SQL 数据库 现在我们需要运行计划任务来发送短信提醒 我的印象是 Azure Web Jobs 非常适合此任务 但在启动和运行它时遇到了一些问题 我已将控制台应用程序添加到
  • 寻找最接近 0 的数字

    我有一个整数数组 我需要找到最接近零的一个 正整数优先于负整数 这是我到目前为止的代码 public class CloseToZero public static void main String args int data 2 3 2
  • InnoSetup,在运行时更改 Uninstallable 属性行为?

    SCENARIO 我创建了一个安装程序 它将安装恶意软件应用程序以用于教育目的 该安装程序包含以下两个任务 Tasks Name hidden Description Hidden mode GroupDescription Install
  • pyqtgraph中设置背景颜色的问题

    我在 python 中使用 pyqtgraph 模块时遇到问题 当我将白色背景颜色放入 glscatterplot 时 散点就消失了 就像背景颜色添加到散点图的颜色中一样 因此一切都是白色的 这是我使用的一段代码 w gl GLViewWi
  • Gem 安装 therubyracer -v '0.11.4'?

    我几乎要疯狂地安装红宝石赛车手 我知道有很多人和我有同样的问题 我也看过这些问题 但对我来说太复杂了 因为不同的情况有不同的解决方案 而事实上 一直没有很好的办法来解决这个问题 我的问题类似于this https github com co