Fix libv8 / therubyracer installing error
Public
13 Feb 11:02

libv8 - system

  • First, you need to have libv8 installed on your Mac:
    brew tap homebrew/versions
    brew install v8-315
    

libv8 - gem

  • Then, you need to check version of the gem that failed to install, it’s usually in line containing
    Make sure that `gem install libv8 -v '3.16.14.19'` succeeds before bundling.
    
  • Finally, you have to install the gem with passing system libv8 to the gem command:
    gem install libv8 -v '3.16.14.19' -- --with-system-v8
    

therubyracer

  • Similarly to libv8 gem, here you’ll also need to check the gem version.
  • Then, you need to pass libv8 directory to the gem install command:
    gem install therubyracer -v '0.12.2' -- --with-v8-dir=/usr/local/opt/v8\@3.15/
    

    This directory may change because of using newer version of libv8.

Comments

Joe
aleksander
Thanks @wolf, I always needed a comprehensive solution for this problem