rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.66k stars 191 forks source link

cannot gem install after the latest Command Line Tools 6.3 update #338

Closed brentredd closed 9 years ago

brentredd commented 9 years ago

Running Ruby 2.2.1 and OS X 10.10.3. The latest Command Line Tools update appears to break therubyracer or libv8. This might actually be a bug with Command Line Tools 6.3 and not therubyracer. I've tried uninstalling libv8 (3.16.14.7 x86_64-darwin-14) and reinstaling using --with-system-v8 and also deleting my Gemfile.lock and running bundle. When I run gem install therubyracer -v '0.12.2' I get:

/Users/***/.rvm/rubies/ruby-2.2.1/bin/ruby -r ./siteconf20150410-38106-1vsw72u.rb extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... 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:6:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/vector:265:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/__bit_reference:15:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/algorithm:628:
In file included from /Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/memory:604:
/Library/Developer/CommandLineTools/usr/bin/../include/c++/v1/iterator:341:10: fatal error: '__debug' file not found
#include <__debug>
         ^
1 error generated.
make: *** [accessor.o] Error 1

make failed, exit code 2
brentredd commented 9 years ago

Downgrading Command Line Tools to 6.2 works for now until this gets resolved (I'm guessing by Apple):

  1. go to https://developer.apple.com/downloads/index.action
  2. download "Command Line Tools (OS X 10.10) for Xcode - Xcode 6.2"
  3. gem install therubyracer -v '0.12.2'
ignisf commented 9 years ago

Searching for the error message on Google yields results that lead me to believe that it indeed is a bug in the development environment provided by Apple. Thank you for the heads up

AmirolAhmad commented 9 years ago

+1

raszi commented 9 years ago

This was the only way to install this gem for me as well. :disappointed:

cowboyd commented 9 years ago

Yes, this is a bug in the Command Line Tools distributed by Apple.

http://stackoverflow.com/questions/29529455/missing-c-header-debug-after-updating-osx-command-line-tools-6-3

Until they release an official fix, the recommended course of action is to manually install version 6.2

irealva commented 9 years ago

Thanks! Reverting to version 6.2 solved it for me.

akiynkmr commented 9 years ago

Thank you for this solution!

sodabrew commented 9 years ago

The official fix is Xcode 6.3.1 and/or Command Line Tools 6.3 with release date of Apr 21, 2015. The original buggy CLT 6.3 was released on Apr 9, 2015.

phyzzld commented 9 years ago

I just installed Command Line Tools 6.4 on 10.10.4, but I cannot install therubyracer 0.12.2. Initially both libv8 and therubyracer failed to install, but I reinstalled ruby 2.0.0-p353 and now libv8 3.16.14.8 installs with no problems but therubyracer still fails. The error does not look the same as reddshack but thought I would ask here since the new tools did not appear to totally solve my problem.

Error message from bundle install:

Installing therubyracer 0.12.2 with native extensions

Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

    /Users/***/.rbenv/versions/2.0.0-p353/bin/ruby extconf.rb
checking for main() in -lpthread... yes
checking for main() in -lobjc... yes
checking for v8.h... yes
checking for main() in -lv8... yes
creating Makefile

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:3915:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
      PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                                   ^
/usr/local/include/v8.h:3943:36: error: 'v8::PropertyHandlerFlags' is not a class, namespace, or scoped enumeration
      PropertyHandlerFlags flags = PropertyHandlerFlags::kNone)
                                   ^
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> {
                                  ~~~~^
./rr.h:358:51: error: expected class name
class ScriptData : public Pointer<v8::ScriptData> {
                                                  ^
./rr.h:360:21: error: no type named 'ScriptData' in namespace 'v8'; did you mean simply 'ScriptData'?
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                    ^~~~~~~~~~~~~~
                    ScriptData
./rr.h:358:7: note: 'ScriptData' declared here
class ScriptData : public Pointer<v8::ScriptData> {
      ^
./rr.h:360:54: error: no member named 'ScriptData' in namespace 'v8'
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                                                 ~~~~^
./rr.h:360:65: error: expected class member or base class name
  inline ScriptData(v8::ScriptData* d) : Pointer<v8::ScriptData>(d) {};
                                                                ^
./rr.h:360:65: error: expected '{' or ','
./rr.h:361:48: error: no member named 'ScriptData' in namespace 'v8'
  inline ScriptData(VALUE value) : Pointer<v8::ScriptData>(value) {}
                                           ~~~~^
./rr.h:361:59: error: expected class member or base class name
  inline ScriptData(VALUE value) : Pointer<v8::ScriptData>(value) {}
                                                          ^
./rr.h:361:59: error: expected '{' or ','
./rr.h:463:14: error: no type named 'AccessorGetter' in namespace 'v8'
  inline v8::AccessorGetter accessorGetter() {return &AccessorGetter;}
         ~~~~^
./rr.h:464:14: error: no type named 'AccessorSetter' in namespace 'v8'
  inline v8::AccessorSetter accessorSetter() {return RTEST(set) ? &AccessorSetter : 0;}
         ~~~~^
./rr.h:466:14: error: no type named 'NamedPropertyGetter' in namespace 'v8'
  inline v8::NamedPropertyGetter namedPropertyGetter() {return &NamedPropertyGetter;}
         ~~~~^
./rr.h:467:14: error: no type named 'NamedPropertySetter' in namespace 'v8'
  inline v8::NamedPropertySetter namedPropertySetter() {return RTEST(set) ? &NamedPropertySetter : 0;}
         ~~~~^
./rr.h:468:14: error: no type named 'NamedPropertyQuery' in namespace 'v8'
  inline v8::NamedPropertyQuery namedPropertyQuery() {return RTEST(query) ? &NamedPropertyQuery : 0;}
         ~~~~^
./rr.h:469:14: error: no type named 'NamedPropertyDeleter' in namespace 'v8'
  inline v8::NamedPropertyDeleter namedPropertyDeleter() {return RTEST(deleter) ? &NamedPropertyDeleter : 0;}
         ~~~~^
./rr.h:470:14: error: no type named 'NamedPropertyEnumerator' in namespace 'v8'
  inline v8::NamedPropertyEnumerator namedPropertyEnumerator() {return RTEST(enumerator) ? &NamedPropertyEnumerator : 0;}
         ~~~~^
./rr.h:472:14: error: no type named 'IndexedPropertyGetter' in namespace 'v8'
  inline v8::IndexedPropertyGetter indexedPropertyGetter() {return &IndexedPropertyGetter;}
         ~~~~^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.
make: *** [accessor.o] Error 1

Gem files will remain installed in /Users/***/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/therubyracer-0.12.2 for inspection.
Results logged to /Users/***/.rbenv/versions/2.0.0-p353/lib/ruby/gems/2.0.0/gems/therubyracer-0.12.2/ext/v8/gem_make.out
An error occurred while installing therubyracer (0.12.2), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.12.2'` succeeds before bundling.
sodabrew commented 9 years ago

Please open a new issue for a new issue.

cmthakur commented 9 years ago

facing same issue as reported by @phyzzld,

brentredd commented 9 years ago

wait for the new version of libv8 or build the gem yourself with rake https://github.com/cowboyd/libv8/pull/177

cmthakur commented 9 years ago

After updating my command line to 6.4 and then performing brew upgrade, the problem got resolved.

boilsquid commented 9 years ago

can confirm updating command line tools to 6.4 and performing brew update, does solve this problem.

sodabrew commented 9 years ago

Thank you all for reporting back that Command Line Tools 6.4 works.