rubyjs / therubyracer

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

OSX 10.10 Yosemite gem install fails: You have to install development tools first #304

Closed PhilCoggins closed 10 years ago

PhilCoggins commented 10 years ago

Note: this may not be an issue with therubyracer. I have checked https://github.com/cowboyd/therubyracer/issues/301 and this seems to be unrelated to my issue.

I just installed yosemite 10.10, using XCode 6 command line tools (set from XCode).

$ gem install therubyracer
Fetching: libv8-3.16.14.3-x86_64-darwin-13.gem (100%)
Successfully installed libv8-3.16.14.3-x86_64-darwin-13
Fetching: therubyracer-0.12.1.gem (100%)
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

    /Users/philcoggins/.rbenv/versions/2.1.2/bin/ruby extconf.rb
checking for main() in -lpthread... *** 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=/Users/philcoggins/.rbenv/versions/2.1.2/bin/ruby
    --with-pthreadlib
    --without-pthreadlib
/Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:456:in `try_do': The compiler failed to generate an executable file. (RuntimeError)
You have to install development tools first.
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:541:in `try_link0'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:556:in `try_link'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:742:in `try_func'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:973:in `block in have_library'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:918:in `block in checking_for'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block (2 levels) in postpone'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:351:in `block in postpone'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:321:in `open'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:347:in `postpone'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:917:in `checking_for'
    from /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/2.1.0/mkmf.rb:968:in `have_library'
    from extconf.rb:3:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/philcoggins/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/therubyracer-0.12.1/gem_make.out
$ gcc -v
Configured with: --prefix=/Applications/Xcode6-Beta2.app/Contents/Developer/usr --with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn)
Target: x86_64-apple-darwin14.0.0
Thread model: posix
$ which gcc
/usr/bin/gcc
$ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates

Thoughts?

PhilCoggins commented 10 years ago

Checked software updates for my OS and I haven't yet installed update 1.0 for 10.10. It is installing now, will update to see if this fixes the problem.

EDIT 1: This did not resolve the issue.

ignisf commented 10 years ago

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.

What does the mkmf.log file say?

PhilCoggins commented 10 years ago
$ cat ./ruby/gems/2.1.0/extensions/x86_64-darwin-13/2.1.0-static/therubyracer-0.11.4/mkmf.log
"gcc-4.2 -o conftest -I/Users/philcoggins/.rbenv/versions/2.1.2/include/ruby-2.1.0/x86_64-darwin13.0 -I/Users/philcoggins/.rbenv/versions/2.1.2/include/ruby-2.1.0/ruby/backward -I/Users/philcoggins/.rbenv/versions/2.1.2/include/ruby-2.1.0 -I. -I/Users/philcoggins/.rbenv/versions/2.1.2/include  -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT    -O3 -Wno-error=shorten-64-to-32  -pipe conftest.c  -L. -L/Users/philcoggins/.rbenv/versions/2.1.2/lib -L. -L/Users/philcoggins/.rbenv/versions/2.1.2/lib  -fstack-protector -L/usr/local/lib     -lruby-static -framework CoreFoundation  -lpthread -lgmp -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2: 
3: int main(int argc, char **argv)
4: {
5:   return 0;
6: }
/* end */
$ which gcc-4.2
gcc-4.2 not found
PhilCoggins commented 10 years ago

So clearly ruby is trying to use gcc-4.2, which doesn't exist in my path.

I could easily symlink gcc to gcc-4.2 and be done with it, but that wouldn't feel right.

Somewhere along the way, someone is deciding to use gcc-4.2 instead of the gcc used by command line tools. Who do I need to be bugging to fix this? Would the apple developer forums be the right place to go?

jasdeepsingh commented 10 years ago

Having the exact same issue..

➜ ~ which gcc
/usr/bin/gcc
➜ ~ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/local/Cellar/gcc48/4.8.3/libexec/gcc/x86_64-apple-darwin14.0.0/4.8.3/lto-wrapper
Target: x86_64-apple-darwin14.0.0
Configured with: ../configure --build=x86_64-apple-darwin14.0.0 --prefix=/usr/local/Cellar/gcc48/4.8.3 --enable-languages=c,c++,objc,obj-c++ --program-suffix=-4.8 --with-gmp=/usr/local/opt/gmp4 --with-mpfr=/usr/local/opt/mpfr2 --with-mpc=/usr/local/opt/libmpc08 --with-cloog=/usr/local/opt/cloog018 --with-isl=/usr/local/opt/isl011 --with-system-zlib --enable-version-specific-runtime-libs --enable-libstdcxx-time=yes --enable-stage1-checking --enable-checking=release --enable-lto --disable-werror --with-pkgversion='Homebrew gcc48 4.8.3' --with-bugurl=https://github.com/Homebrew/homebrew-versions/issues --enable-plugin --disable-nls --enable-multilib
Thread model: posix
gcc version 4.8.3 (Homebrew gcc48 4.8.3)
➜ ~ xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
skandragon commented 10 years ago

I had trouble with the rbzmq gem, and fixed this by ensuring I did not have gcc-4.2 in my path and then re-installing ruby via "rbenv install 2.1.2"

I had gcc-4.2 in my path, probably from a bad idea (or a previous OS X install) so I had to fist remove gcc. I put them in a directory called "disabled-sma" so if needed, I could recover them.

This "fixed" it ; you might want to see if this also fixes this gem.

jasdeepsingh commented 10 years ago

@skandragon what version of gcc you did had in your path, after you removed gcc-4.2 ? Also, are you able to install 1.9.3?

skandragon commented 10 years ago

I may have spoken too soon; I cannot build the libv8 gem, but it might be that something else needs to be built first. brew is probably half-ancient by now, so I should nuke and reinstall I suspect.

$ gcc -v Configured with: --prefix=/Applications/Xcode6-Beta.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode6-Beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.sdk/usr/include/c++/4.2.1 Apple LLVM version 6.0 (clang-600.0.34.4) (based on LLVM 3.5svn) Target: x86_64-apple-darwin14.0.0 Thread model: posix

shanbhardwaj commented 10 years ago

I have been able to install libv8 with

gem install libv8 -v 3.16.14.3 -- --with-system-v8

renatorozas commented 10 years ago

Any updates on this? :-/

PhilCoggins commented 10 years ago

Do you have apple command line tools installed through brew? brew install apple-gcc42

renatorozas commented 10 years ago

@PhilCoggins Yes I do. I tried exporting CC=/path/to/gcc-4.2 but it didn't work either.

krazyjakee commented 10 years ago

@PhilCoggins did you open a thread on the apple developer forums?

Is anyone any further with getting this working? I'm trying to install it as part of therubyracer and am unable to.

:+1:

renatorozas commented 10 years ago

I just tried installing the gem using gcc49, still getting the same error.

On Aug 4, 2014, at 6:46 PM, Jake Cattrall notifications@github.com wrote:

@PhilCoggins https://github.com/PhilCoggins did you open a thread on the apple developer forums?

Is anyone any further with getting this working? I'm trying to install it as part of therubyracer and am unable to.

— Reply to this email directly or view it on GitHub https://github.com/cowboyd/therubyracer/issues/304#issuecomment-51128447.

skandragon commented 10 years ago

I may be unpopular, but "install gcc 4.2" is not the same as "install apple developer tools." I have the latest dev tools installed, and the latest Xcode, and it does not build. I cannot install another version of gcc because of other reasons, but it should build and install with the latest Xcode + apple provided dev tools.

aaronlifton3 commented 10 years ago

./rr.h:510:118: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'? static v8::Handlev8::Value NamedPropertySetter(v8::Localv8::String property, v8::Localv8::Value value, const v8::AccessorInfo& info); ^~~~ Accessor ./rr.h:456:7: note: 'Accessor' declared here class Accessor { ^ 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/aaron/.rvm/gems/ruby-2.0.0-p247/gems/therubyracer-0.12.1 for inspection. Results logged to /Users/aaron/.rvm/gems/ruby-2.0.0-p247/extensions/x86_64-darwin-14/2.0.0/therubyracer-0.12.1/gem_make.out An error occurred while installing therubyracer (0.12.1), and Bundler cannot continue. Make sure that gem install therubyracer -v '0.12.1' succeeds before bundling.

ignisf commented 10 years ago

@aaronlifton, what version of libv8 are you trying to link against?

mattheworiordan commented 10 years ago

I too have this issue on Yosemite beta, I have tried CC=/usr/local/Cellar/gcc/4.9.1_1/bin/gcc-4.9 gem install therubyracer and gem install therubyracer on Ruby versions 2.1.2 and 2.0.0-p353 and I consistently get the same error unfortunately:

Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
    ERROR: Failed to build gem native extension.

    /Users/matthew/.rbenv/versions/2.1.2/bin/ruby 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:
./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;}
         ~~~~^
./rr.h:473:14: error: no type named 'IndexedPropertySetter' in namespace 'v8'
  inline v8::IndexedPropertySetter indexedPropertySetter() {return RTEST(set) ? &IndexedPropertySetter : 0;}
         ~~~~^
./rr.h:474:14: error: no type named 'IndexedPropertyQuery' in namespace 'v8'
  inline v8::IndexedPropertyQuery indexedPropertyQuery() {return RTEST(query) ? &IndexedPropertyQuery : 0;}
         ~~~~^
./rr.h:475:14: error: no type named 'IndexedPropertyDeleter' in namespace 'v8'
  inline v8::IndexedPropertyDeleter indexedPropertyDeleter() {return RTEST(deleter) ? &IndexedPropertyDeleter : 0;}
         ~~~~^
./rr.h:476:14: error: no type named 'IndexedPropertyEnumerator' in namespace 'v8'
  inline v8::IndexedPropertyEnumerator indexedPropertyEnumerator() {return RTEST(enumerator) ? &IndexedPropertyEnumerator : 0;}
         ~~~~^
./rr.h:482:16: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
    Info(const v8::AccessorInfo& info);
               ^~~~~~~~~~~~~~~~
               Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:488:18: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
    inline const v8::AccessorInfo* operator->() {return this->info;}
                 ^~~~~~~~~~~~~~~~
                 Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:502:11: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
    const v8::AccessorInfo* info;
          ^~~~~~~~~~~~~~~~
          Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:506:85: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static v8::Handle<v8::Value> AccessorGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
                                                                                    ^~~~~~~~~~~~~~~~
                                                                                    Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:507:96: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static void AccessorSetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
                                                                                               ^~~~~~~~~~~~~~~~
                                                                                               Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:509:90: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static v8::Handle<v8::Value> NamedPropertyGetter(v8::Local<v8::String> property, const v8::AccessorInfo& info);
                                                                                         ^~~~~~~~~~~~~~~~
                                                                                         Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
./rr.h:510:118: error: no type named 'AccessorInfo' in namespace 'v8'; did you mean 'Accessor'?
  static v8::Handle<v8::Value> NamedPropertySetter(v8::Local<v8::String> property, v8::Local<v8::Value> value, const v8::AccessorInfo& info);
                                                                                                                     ^~~~~~~~~~~~~~~~
                                                                                                                     Accessor
./rr.h:456:7: note: 'Accessor' declared here
class Accessor {
      ^
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/matthew/.rbenv/versions/2.1.2/lib/ruby/gems/2.1.0/gems/therubyracer-0.12.1 for inspection.
Results logged to /Users/matthew/.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

Has anyone else figured a workaround solution?

patricksereno commented 10 years ago

This worked for me (Running Yosemite Beta 1 with x-code command line utils and homebrew ruby 2.1.2p95), although it did throw errors

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.gem
gem install therubyracer
mattheworiordan commented 10 years ago

@patricksereno thanks, that worked a treat for me.

cowboyd commented 10 years ago

You should be able to now use the released version of the libv8

gem install libv8 -v 3.16.4.4

Nosajgames commented 10 years ago

I am still getting the same error while trying to install libv8 using OS X 10.10 DP7

JeffMenos:iugport2 jeffreymenos$ git clone https://github.com/cowboyd/libv8.git Cloning into 'libv8'... remote: Counting objects: 1953, done. remote: Compressing objects: 100% (35/35), done. remote: Total 1953 (delta 10), reused 0 (delta 0) Receiving objects: 100% (1953/1953), 1.53 MiB | 0 bytes/s, done. Resolving deltas: 100% (834/834), done. Checking connectivity... done JeffMenos:iugport2 jeffreymenos$ cd libv8 JeffMenos:libv8 jeffreymenos$ bundle install Fetching gem metadata from https://rubygems.org/......... Resolving dependencies... Using rake 10.3.2

Your user account isn't allowed to install to the system Rubygems. You can cancel this installation and run:

bundle install --path vendor/bundle

to install the gems into ./vendor/bundle/, or you can enter your password and install the bundled gems to Rubygems using sudo.

Password: Installing addressable 2.3.6 Installing diff-lcs 1.2.5 Installing excon 0.39.5 Using multi_json 1.10.1 Installing heroku-api 0.3.19 Installing launchy 2.4.2 Installing netrc 0.7.7 Using mime-types 1.25.1

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

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20140910-11404-8uhmuz.rb extconf.rb 

creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" compiling generator.c clang: warning: -framework CrashReporterSupport: 'linker' input unused linking shared-object json/ext/generator.bundle ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/System/Library/PrivateFrameworks' ld: framework not found CrashReporterSupport clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /var/folders/m0/hvxtshys5m57n_j_8lpkf1_w0000gq/T/bundler20140910-11404-1o1es3g/json-1.8.1/gems/json-1.8.1 for inspection. Results logged to /var/folders/m0/hvxtshys5m57n_j_8lpkf1_w0000gq/T/bundler20140910-11404-1o1es3g/json-1.8.1/extensions/universal-darwin-14/2.0.0/json-1.8.1/gem_make.out An error occurred while installing json (1.8.1), and Bundler cannot continue. Make sure that gem install json -v '1.8.1' succeeds before bundling. JeffMenos:libv8 jeffreymenos$ bundle exec rake clean build binary Could not find gem 'vulcan (>= 0) ruby' in the gems available on this machine. Run bundle install to install missing gems. JeffMenos:libv8 jeffreymenos$ bundle install Fetching gem metadata from https://rubygems.org/......... Resolving dependencies... Using rake 10.3.2 Using addressable 2.3.6 Using diff-lcs 1.2.5 Using excon 0.39.5 Using multi_json 1.10.1 Using heroku-api 0.3.19 Using launchy 2.4.2 Using netrc 0.7.7 Using mime-types 1.25.1

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

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby -r ./siteconf20140910-11519-1gr1cxe.rb extconf.rb 

creating Makefile

make "DESTDIR=" clean

make "DESTDIR=" compiling generator.c clang: warning: -framework CrashReporterSupport: 'linker' input unused linking shared-object json/ext/generator.bundle ld: warning: directory not found for option '-F/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.10.Internal.sdk/System/Library/PrivateFrameworks' ld: framework not found CrashReporterSupport clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *\ [generator.bundle] Error 1

make failed, exit code 2

Gem files will remain installed in /var/folders/m0/hvxtshys5m57n_j_8lpkf1_w0000gq/T/bundler20140910-11519-6mlbxr/json-1.8.1/gems/json-1.8.1 for inspection. Results logged to /var/folders/m0/hvxtshys5m57n_j_8lpkf1_w0000gq/T/bundler20140910-11519-6mlbxr/json-1.8.1/extensions/universal-darwin-14/2.0.0/json-1.8.1/gem_make.out An error occurred while installing json (1.8.1), and Bundler cannot continue. Make sure that gem install json -v '1.8.1' succeeds before bundling. JeffMenos:libv8 jeffreymenos$ gem install libv8 -v 3.16.4.4 ERROR: Could not find a valid gem 'libv8' (= 3.16.4.4) in any repository ERROR: Possible alternatives: libv8 JeffMenos:libv8 jeffreymenos$

mlavandero commented 10 years ago

I am working with the latest 10.10 update and https://github.com/cowboyd/therubyracer/issues/304#issuecomment-48840004 worked for me.

thanks @shanbhardwaj

brucemar10 commented 9 years ago

rvm reinstall ruby --disable-binary

worked for me

ghost commented 9 years ago

I went into my Gemfile.lock and changed libv8 version from 3.16.14.3 to 3.16.14.7. therubyracer and libv8 installed fine after that with 'bundle install'.

OSX 10.10 rvm ruby 2.1.4 gcc 4.2.1

pmsaue0 commented 9 years ago

I was having namespace 'v8' issues that prevented me from installing therubyracer. After deleting Gemfile.lock I was able to proceed.

ghost commented 9 years ago

+1 for libv8 version 3.16.14.7

cowboyd commented 9 years ago

@mgauthier-joist there is a binary Yosemite gem for 3.16.14.7 You can either run bundle update libv8 or if that still doesn't work, recompile ruby.

podlech commented 9 years ago

Hey, this is working for me: https://gist.github.com/jpodlech/837c7e5103c4cf5cb9b1

nhattan commented 9 years ago

Yes, :+1: thanks @shanbhardwaj

franzejr commented 9 years ago

+1 for libv8 version 3.16.14.7

johnfig commented 9 years ago

I had the same issue and this worked for me. Looks like the new versions definitely fixed it.

$ gem install libv8 -v '3.16.14.7' $ bundle

ykwx commented 9 years ago

I had the same issue of therubyracer failing. But first, I had libv8 -v '3.16.14.3' failing for me on the first run. I ran gem install libv8 -v '3.16.14.3' -- --with-system-v8 which worked.

Then therubyracer failed. I ran gem install libv8 -v '3.16.14.7' -- --with-system-v8 which worked, then gem install therubyracer and all was well.

yogurt-island-331 commented 9 years ago

Downgrade the Command Line Tools to 6.2 via Apple's Developer Download Page worked for me. http://stackoverflow.com/questions/29529455/missing-c-header-debug-after-updating-osx-command-line-tools-6-3

barhamd commented 9 years ago

+1 for @shanbhardwaj

anayib commented 9 years ago

Guys, I fixed it out just running the command xcode-select --install which will install developers tools.

Then re-start the terminal/console and run gem install rails -v 4.2.1 or the rails version you want and that's it, it works !, cheers

achempion commented 9 years ago

had the same issue, gem install libv8 -v '3.16.14.11' -- --with-system-v8 works for me, thank you @JonathanFagan :)

derekhubbard commented 9 years ago

Running gem install libv8 -v '3.16.14.11' -- --with-system-v8 worked for me as well. Thanks!

achempion commented 9 years ago

if someone can't fix this issue, just update ruby version to latest, after this I resolved my problems and libv8 have been installed without any additional options

jimbocooper commented 9 years ago

gem install libv8 -v '3.16.14.11' -- --with-system-v8 Worked for me like magic! :) Thanks guys

davidwparker commented 9 years ago

I had to upgrade my ruby version for this to work, I was on ruby-2.0.0-p451 and upgraded to ruby-2.0.0-p576 and was fine.

gguuss commented 8 years ago

The following steps were necessary for me:

  1. Install XCode from app store
  2. Install command line tools for XCode - xcode-select --install
  3. brew install gcc
sghiassy commented 8 years ago

@gguuss instructions worked for me. Thx!

sohamdas commented 8 years ago

Thanks @gguuss. +1

ponyczek commented 8 years ago

Hello,

I had the same as @PhilCoggins I have spent over 3 hours in order to fix this.

I tried tons of solutions: @gguuss 's @cmititiuc 's @patricksereno 's

Nothing worked.

As it turned out my problem was related to the version of ruby itself. My mac kept changing the version to 2.0.0... by default, even though the version specified in rbenv was 2.2.3

I had to make sure that my ruby -v returns ruby 2.2.3p173 (2015-08-18 revision 51636) [x86_64-darwin15] after that bundle install went smooth as ever.

I use Mac OS X Yosemite

jhgorse commented 8 years ago

@ponyczek I have similar issues. For some reason bundler will not use the rvm'd version of ruby, even when selected. When I manually enter the debugger build directory under the rvm environment it bundles just fine.

The symptom is that it tries to use the system ruby which is immutable and the older 2.0.0. I do not know what causes this.