Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Error when running "bundle install" on mac - therubyracer failing to install

I am trying to install rails for the first time on my new macbook pro running OS X 10.9 (Mavericks) and I am running into an issue installing therubyracer. When I do "bundle install" I get this error:

An error occurred while installing therubyracer (0.10.2), and Bundler cannot continue. Make sure that gem install therubyracer -v '0.10.2' succeeds before bundling.

Then I follow their instructions and run

gem install therubyracer -v '0.10.2'

Then I get this error message:

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

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby extconf.rb

checking for main() in -lobjc... yes creating Makefile

make "DESTDIR=" compiling rr.cpp clang: warning: argument unused during compilation: '-rdynamic' rr.cpp:48:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ 1 warning generated. compiling v8.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_array.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_callbacks.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_context.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_date.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_debug.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_exception.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_exception.cpp:10:16: warning: unused variable 'stack' [-Wunused-variable] static void* stack[20]; ^ 1 warning generated. compiling v8_external.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_external.cpp:10:9: warning: unused variable 'references' [-Wunused-variable] VALUE references; ^ 1 warning generated. compiling v8_function.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_handle.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_locker.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_locker.cpp:45:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ v8_locker.cpp:85:5: warning: control reaches end of non-void function [-Wreturn-type] } ^ 2 warnings generated. compiling v8_message.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_object.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_object.cpp:77:19: warning: unused variable 'proto' [-Wunused-variable] Handle proto(rr_rb2v8(prototype)); ^ 1 warning generated. compiling v8_script.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_string.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_template.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_try_catch.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_try_catch.cpp:15:14: warning: initialization of pointer of type 'v8::TryCatch *' to null from a constant boolean expression [-Wbool-conversion] return false; ^~~~~ 1 warning generated. compiling v8_v8.cpp clang: warning: argument unused during compilation: '-rdynamic' compiling v8_value.cpp clang: warning: argument unused during compilation: '-rdynamic' v8_value.cpp:100:9: warning: unused function 'ToInt32' [-Wunused-function] VALUE ToInt32(VALUE self) { ^ 1 warning generated. compiling v8_weakref.cpp clang: warning: argument unused during compilation: '-rdynamic' linking shared-object v8.bundle clang: error: no such file or directory: '/Library/Ruby/Gems/2.0.0/gems/libv8-3.3.10.4/lib/libv8/build/v8/libv8.a' make: * [v8.bundle] Error 1

Gem files will remain installed in /Library/Ruby/Gems/2.0.0/gems/therubyracer-0.10.2 for inspection. Results logged to /Library/Ruby/Gems/2.0.0/gems/therubyracer-0.10.2/ext/v8/gem_make.out

I'm not really sure what this means or how to fix this.

All I really want to do is run my rails projects.

Anyone know what the issue is?

like image 287
Amir Avatar asked Dec 07 '13 14:12

Amir


2 Answers

Do this:

$ gem uninstall libv8 # ignore if this fails
$ gem install libv8 -v 3.16.14.3 -- --with-system-v8 # 2013-08 x86_64-darwin-12 (32.6 MB)

Also edit your Gemfile and force a newer version of therubyracer

gem "therubyracer", "~> 0.12"

Then try again:

$ bundle update
like image 70
Leo Gallucci Avatar answered Oct 06 '22 00:10

Leo Gallucci


Works like a charm! Thanks https://stackoverflow.com/a/58842254/642616

$ brew install [email protected]
$ bundle config build.libv8 --with-system-v8
$ bundle config build.therubyracer --with-v8-dir=$(brew --prefix [email protected])
$ bundle install

@3.15 could be replaced with any other versions.

like image 31
Feuda Avatar answered Oct 06 '22 00:10

Feuda