19

I upgraded ruby to 1.9.3, and now I can't get my server to start. When I run bundle install, it says

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

When I try to install that gem, it says

ERROR:  Error installing libv8:
        ERROR: Failed to build gem native extension.

        /Users/Erica/.rvm/rubies/ruby-1.9.3-p194/bin/ruby extconf.rb
creating Makefile
Compiling v8 for x64
Using python 2.7.1
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher
Using compiler: g++
Unable to find a compiler officially supported by v8.
It is recommended to use GCC v4.4 or higher

I'm an HTML/CSS coder, not really a Ruby developer, so any thoughts are really appreciated.

Erica
  • 409
  • 4
  • 12
  • 1
    You need to install Xcode command line tools. If you google it you should find a link to download on Apple website (but only tools, not whole Xcode 4GB+ package!) – Mike Szyndel Sep 05 '13 at 20:59
  • 1
    I have Xcode and its command line tools installed already. – Erica Sep 05 '13 at 21:05
  • Given this error I don't think so (or you have broken PATH which is very unlikely) – Mike Szyndel Sep 06 '13 at 05:20
  • Please add the output from `ls -l $(which g++)` and `g++ --version`. – Tim Moore Sep 06 '13 at 07:31
  • `ls: --version: No such file or directory ls: and: No such file or directory ls: g++: No such file or directory lrwxr-xr-x 1 root wheel 12 Sep 5 22:47 /usr/bin/g++ -> llvm-g++-4.2` – Erica Sep 06 '13 at 13:10
  • 1
    See http://stackoverflow.com/questions/19546730/error-when-installing-libv8-3-11-8-3 answer with: https://github.com/cowboyd/libv8/issues/107 temporary issue, need to install the gem manually. I downloaded and did "gem install ~/Downloads/v8blahblahblah.gem" – xxjjnn Nov 01 '13 at 17:58

6 Answers6

32

I resolved this issue by using the following command:

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

It works with RVM on Mavericks.

https://stackoverflow.com/a/19667419/763744

Community
  • 1
  • 1
Zernel
  • 1,487
  • 2
  • 15
  • 27
9

Try reinstalling v8 in homebrew:

gem uninstall libv8
brew install v8
gem install libv8
RonanOD
  • 876
  • 1
  • 9
  • 19
3

Do:

gem install rmagick -v '2.13.2'
gem install libv8 -v 3.11.8.17 -- --with-system-v8
Baldrick
  • 23,882
  • 6
  • 74
  • 79
abcd_win
  • 107
  • 1
  • 6
0

I encountered this problem a few times already, first thing I'd try is to (re)install command line tools. Normally should work.

Another attempt that succeeded once was uninstalling libv8, and then installing it again. It takes ages...

davegson
  • 8,205
  • 4
  • 51
  • 71
  • Thanks! I reinstalled the command line tools (from https://developer.apple.com/downloads/index.action) and tried another bundle install, still getting the same error. I'll try to uninstall and reinstall libv8 now... – Erica Sep 06 '13 at 02:58
  • No, I tried several times to manually uninstall and reinstall that gem and therubyracer, but still getting the same error. – Erica Sep 06 '13 at 13:09
  • @Erica did you ever figure it out? I am having the same issue. – Matt Sep 25 '13 at 21:36
  • 1
    @Matt No :( I ended up doing a clean install of my OS and reinstalling everything. It could have been my local installs of MAMP or Python conflicting with the project's versions? Not sure. But the clean install is kinda nice anyways. – Erica Sep 26 '13 at 01:36
0

This simple solution worked for me:

$ gem uninstall libv8 # select "All Versions" if prompted
$ gem install libv8
bricker
  • 8,911
  • 2
  • 44
  • 54
0

I had this same problem when I upgraded from OSX Mountain Lion to OSX Mavericks.

Upgrading from ruby-1.8.7-p354 to ruby-1.8.7-375 did the trick for me.

libv8 (3.16.14.3-x86_64-darwin-13) and the therubyracer (0.12.0) gems installed without problem.

assuming you use rbenv:

rbenv versions
  system
  * 1.8.7-p354
  2.0.0-rc2

rbenv uninstall 1.8.7-p354
rbenv install 1.8.7-p375

rbenv versions
  system
  * 1.8.7-p375
  2.0.0-rc2

bundle install
nelsonenzo
  • 682
  • 5
  • 9