rubyjs / therubyracer

Embed the V8 Javascript Interpreter into Ruby
1.67k stars 190 forks source link

Failed installation with Mac OSX 10.11 #390

Closed dinhtuan1991vt closed 8 years ago

dinhtuan1991vt commented 8 years ago

When I run bundle install, It show errors:

Installing therubyracer 0.11.4 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

/Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/bin/ruby -r ./siteconf20151004-7379-vo64z1.rb extconf.rb --with-v8-dir
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
--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/Storm1/.rvm/rubies/ruby-1.9.3-p551/bin/ruby
--with-pthreadlib
--without-pthreadlib
/Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:381:in `try_do': The compiler failed     to generate an executable file. (RuntimeError)
You have to install development tools first.
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:461:in `try_link0'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:476:in `try_link'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:619:in `try_func'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:845:in `block in have_library'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:790:in `block in checking_for'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:284:in `block (2 levels) in postpone'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:284:in `block in postpone'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:254:in `open'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:280:in `postpone'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:789:in `checking_for'
from /Users/Storm1/.rvm/rubies/ruby-1.9.3-p551/lib/ruby/1.9.1/mkmf.rb:840:in `have_library'
from extconf.rb:3:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/Storm1/.rvm/gems/ruby-1.9.3-p551@project/gems/therubyracer-0.11.4 for inspection.
Results logged to /Users/Storm1/.rvm/gems/ruby-1.9.3-p551@project/extensions/x86_64-darwin 14/1.9.1/therubyracer-0.11.4/gem_make.out
An error occurred while installing therubyracer (0.11.4), and Bundler cannot continue.
Make sure that `gem install therubyracer -v '0.11.4'` succeeds before bundling.
LeoSL commented 8 years ago

@dinhtuan1991vt did you try to run gem install with --with-opt-lib flag?

snoblenet commented 8 years ago

How do you do that?

I got:

$ gem install therubyracer --with-opt-lib
ERROR:  While executing gem ... (OptionParser::InvalidOption)
    invalid option: --with-opt-lib
snoblenet commented 8 years ago

Also failing:

bundle config build.therubyracer --with-opt-lib
bundle install
Installing therubyracer 0.12.2 with native extensions

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

    /Users/steven/.rvm/rubies/ruby-2.2.2/bin/ruby -r ./siteconf20151008-9512-l7noxv.rb extconf.rb --with-opt-lib
/Users/steven/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:1724:in `dir_config': undefined method `split' for true:TrueClass (NoMethodError)
    from /Users/steven/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:2482:in `init_mkmf'
    from /Users/steven/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:2525:in `<module:MakeMakefile>'
    from /Users/steven/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/mkmf.rb:47:in `<top (required)>'
    from /Users/steven/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/steven/.rvm/rubies/ruby-2.2.2/lib/ruby/2.2.0/rubygems/core_ext/kernel_require.rb:54:in `require'
    from extconf.rb:1:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/steven/.rvm/gems/ruby-2.2.2/gems/therubyracer-0.12.2 for inspection.
Results logged to /Users/steven/.rvm/gems/ruby-2.2.2/extensions/x86_64-darwin-14/2.2.0/therubyracer-0.12.2/gem_make.out
An error occurred while installing therubyracer (0.12.2), and Bundler cannot continue.
silasjmatson commented 8 years ago

I am having the same issue as @snoblenet when using --with-opt-lib

dinhtuan1991vt commented 8 years ago

I'm having the same issue too

bruschill commented 8 years ago

Has anyone been able to get by this? I'm having the same issue as well. Also tried passing the --with-system-v8 flag.

tab commented 8 years ago

I'm having the same issue too, but that's helped me:

brew install v8
gem install libv8 -v '3.16.14.7' -- --with-system-v8
bundle install
nicolasblanco commented 8 years ago

@tab solution worked for me, thanks.

rossi-jeff commented 8 years ago

I am having the same issue and have spect quite a bit of time on it to no avail. Have an existing production application trying to get bundle set up on new computer from svn so changing gem versions is not preferable. Attempting to install -v 0.12.1

jeffreyrossi$ brew info v8 v8: stable 4.5.103.35 (bottled) Google's JavaScript engine https://code.google.com/p/v8/ /usr/local/Cellar/v8/4.5.103.35 (25 files, 29M) * Poured from bottle From: https://github.com/Homebrew/homebrew/blob/master/Library/Formula/v8.rb ==> Dependencies Optional: readline ✔ ==> Options --with-readline Use readline instead of libedit

have libv8 (3.16.14.7)

----- from bundle install ----

Installing therubyracer 0.12.1 with native extensions

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

/Users/jeffreyrossi/.rvm/rubies/ruby-1.9.3-p550/bin/ruby -r ./siteconf20151015-12444-30zla5.rb extconf.rb

checking for main() in -lpthread... yes checking for main() in -lobjc... yes checking for v8.h... no * 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 --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/jeffreyrossi/.rvm/rubies/ruby-1.9.3-p550/bin/ruby --with-pthreadlib --without-pthreadlib --with-objclib --without-objclib --enable-debug --disable-debug --with-v8-dir --without-v8-dir --with-v8-include --without-v8-include=${v8-dir}/include --with-v8-lib --without-v8-lib=${v8-dir}/ /Users/jeffreyrossi/.rvm/gems/ruby-1.9.3-p550@upgrade/gems/libv8-3.16.14.7/ext/libv8/location.rb:50:in `configure': You have chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError) and not the one that is bundle with the libv8 rubygem. However, it could not be located. please make sure you have a version of v8 that is compatible with 3.16.14.7 installed. You may need to special --with-v8-dir options if it is in a non-standard location

thanks, The Mgmt

from /Users/jeffreyrossi/.rvm/gems/ruby-1.9.3-p550@upgrade/gems/libv8-3.16.14.7/lib/libv8.rb:7:in `configure_makefile'
from extconf.rb:32:in `<main>'

extconf failed, exit code 1

Gem files will remain installed in /Users/jeffreyrossi/.rvm/gems/ruby-1.9.3-p550@upgrade/gems/therubyracer-0.12.1 for inspection. Results logged to /Users/jeffreyrossi/.rvm/gems/ruby-1.9.3-p550@upgrade/extensions/x86_64-darwin-15/1.9.1/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.

--- from mkmf.log --------

find_header: checking for v8.h... -------------------- no

"/usr/local/bin/gcc-4.9 -E -I/Users/jeffreyrossi/.rvm/rubies/ruby-1.9.3-p550/include/ruby-1.9.1/x86_64-darwin15.0.0 -I/Users/jeffreyrossi/.rvm/rubies/ruby-1.9.3-p550/include/ruby-1.9.1/ruby/backward -I/Users/jeffreyrossi/.rvm/rubies/ruby-1.9.3-p550/include/ruby-1.9.1 -I. -D_XOPEN_SOURCE -D_DARWIN_CSOURCE -I/usr/local/opt/libyaml/include -I/usr/local/opt/readline/include -I/usr/local/opt/libksba/include -I/usr/local/opt/openssl/include -Wall -g -rdynamic -O3 -ggdb -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fno-common -pipe conftest.c -o conftest.i" gcc-4.9: error: unrecognized command line option '-rdynamic' checked program was: /* begin / 1: #include "ruby.h" 2: 3: #include <v8.h> /_ end */

cowboyd commented 8 years ago

v 0.11.x is no longer supported.

cowboyd commented 8 years ago

For those coming to this issue and using the latest version of therubyracer, please be sure you upgrade to the latest libv8