40
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

El Capitan libv8がインストール出来ない

Last updated at Posted at 2015-10-01

OSX 10.11 El Capitanにアップグレードした際に、Ruby on Railsの環境構築で失敗したので個人的なメモ。

bundle installで失敗したgem

  • libv8
  • therubyracer

libv8のエラー

こんな感じのエラーが出た

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    /usr/local/var/rbenv/versions/2.1.7/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.10
Using compiler: /usr/bin/c++ (clang version 7.0.0)
In file included from ../src/conversions.cc:32:
In file included from ../src/conversions-inl.h:43:
../src/scanner.h:444:5: error: unused typedef '__StaticAssertTypedef__444' [-Werror,-Wunused-local-typedef]
    STATIC_ASSERT(kCharacterLookaheadBufferSize == 1);
    ^
../src/checks.h:283:30: note: expanded from macro 'STATIC_ASSERT'
#define STATIC_ASSERT(test)  STATIC_CHECK(test)
                             ^
../src/checks.h:251:5: note: expanded from macro 'STATIC_CHECK'
    SEMI_STATIC_JOIN(__StaticAssertTypedef__, __LINE__)
    ^
../src/checks.h:240:32: note: expanded from macro 'SEMI_STATIC_JOIN'
#define SEMI_STATIC_JOIN(a, b) SEMI_STATIC_JOIN_HELPER(a, b)
                               ^
../src/checks.h:241:39: note: expanded from macro 'SEMI_STATIC_JOIN_HELPER'
#define SEMI_STATIC_JOIN_HELPER(a, b) a##b
                                      ^
<scratch space>:63:1: note: expanded from here
__StaticAssertTypedef__444

...

apple-gcc42のインストール

apple-gcc42をインストールすることで回避できた。

$ brew tap homebrew/dupes
$ brew install apple-gcc42

$ export CC=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/gcc-4.2
$ export CXX=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/g++-4.2
$ export CPP=/usr/local/Cellar/apple-gcc42/4.2.1-5666.3/bin/cpp-4.2

$ gem install therubyracer

インストールされたgemのバージョン

$ gem list --local

libv8 (3.16.14.11 x86_64-darwin-15)
therubyracer (0.12.2)

あとはいつも通り、bundle installすればOK

参考

40
42
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
40
42

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?