user439407
user439407

Reputation: 1756

Cannot install libv8 gem on OS X Mavericks

I am having problems installing the Ruby libv8 gem on OS X Mavericks(10.9.4), I get the following error:

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

/usr/local/rvm/rubies/ruby-2.0.0-p451/bin/ruby extconf.rb
creating Makefile
/usr/local/rvm/gems/ruby-2.0.0-p451/gems/libv8-3.11.8.13/ext/libv8/compiler.rb:30: warning: Insecure world writable dir /usr/local/rvm/gems/ruby-2.0.0-p451/bin in PATH, mode 040777
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
../src/cached-powers.cc:136:18: error: unused variable 'kCachedPowersLength' [-Werror,-Wunused-const-variable]
static const int kCachedPowersLength = ARRAY_SIZE(kCachedPowers);

I tried to tell clang not to error out when there is an unused constant using the following, but to no avail the result was the same:

ARCHFLAGS=-Wno-error=unused-const-variable gem install libv8 -v '3.11.8.13'

What command line option am I missing?

Thanks

Upvotes: 1

Views: 2088

Answers (1)

Fred
Fred

Reputation: 421

I had the same issue on my machine. Using the --with-system-v8 flag resolved the problem. Full documentation on this flag here.

Upvotes: 8

Related Questions