therubyracer - Gem::Ext::BuildError: ERROR: Failed to build gem native extension

前端 未结 14 1759
抹茶落季
抹茶落季 2020-12-07 11:09

I\'m trying to install the following gem versions on Mavericks

  • libv8 (3.16.14.3)
  • therubyracer (0.12.1)

Obviously therubyracer gems depe

相关标签:
14条回答
  • 2020-12-07 11:26

    I just run bundle update, and it worked for me.

    Obs.: Using Ruby 2.3.0

    0 讨论(0)
  • 2020-12-07 11:28

    This steps worked for me.

    OS: Maverick Ruby: 2.1.1

    gem uninstall libv8
    gem install therubyracer -v '0.11.3'
    gem install libv8 -v '3.11.8.13' -- --with-system-v8
    
    0 讨论(0)
  • 2020-12-07 11:29

    I've got this issue for MacOS Mojave 10.14.2 and I was able to fix this issue when I found where package v8-315 was installed and what the folder name was. In my case, it was here /usr/local/opt/v8@3.15.

    To fix this, I've run next:

    brew install v8-315
    gem install libv8 -v '3.16.14.15' -- --with-system-v
    gem install therubyracer -v '0.12.2' -- --with-system-v8 --with-v8-dir=/usr/local/opt/v8@3.15
    bundle install
    
    0 讨论(0)
  • 2020-12-07 11:30

    I couldn't get therubyracer to build on macOS Catalina 10.15 due to the libv8 dependency, despite installing the x64 (64-bit variant) of libv8.

    The solution for me, was to switch from therubyracer to mini_racer, the mini_racer gem installed (without needing to build locally) and, hey presto! I could continue.

    Try it!

    0 讨论(0)
  • 2020-12-07 11:33

    The above answers did not work for me; my bundler config has disable-shared-gems enabled which causes additional issues.

    I'm using Yosemite 10.10.1, Rails 3.2.x, and Ruby 1.9.3p550.

    The following snippet in my bin/setup has fixed the issue for me.

    if ! bundle show therubyracer; then
        bundle config build.libv8 --with-system-v8
        gem install --install-dir vendor/bundle libv8 -v 3.16.14.7
        gem install libv8 -v 3.16.14.7
        gem install --install-dir vendor/bundle therubyracer 
    fi
    
    0 讨论(0)
  • 2020-12-07 11:37

    I found a workaround to the above problem.

    This is more of a compatibility among libv8 and therubyracer.

    gem install libv8 -v '3.3.10.4' -- --with-system-v8
    
    gem install therubyracer -v '0.10.2'
    

    This should work fine as both the versions are compatible with me. Initially I was trying to install the version 0.12.0 for therubyracer and was facing the issue. Once I switched to version 0.10.2, everything worked fine.

    My current OS: Mavericks

    0 讨论(0)
提交回复
热议问题