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

后端 未结 16 1064
不思量自难忘°
不思量自难忘° 2020-11-27 09:21

I made a rails project with,

rails new test_bootstrap.

succeeded.

moved to the project dir and added the gems

gem \         


        
相关标签:
16条回答
  • 2020-11-27 09:51

    I tried the solution listed above command which looks very fine for installing individual gem, but for bundler users - you should use bundle config

    Use

    bundle config build.libv8 --with-system-v8 
    

    and

    bundle config build.therubyracer --with-system-v8
    

    to configure bundler to take the parameters to be used while installing specific gem

    0 讨论(0)
  • 2020-11-27 09:51

    Try with

    gem "therubyracer", "~> 0.10.2" to Gemfile

    And it will install dependent gem libv8 (3.3.10.4) and the issue of build gem native extension failure got resolve.

    0 讨论(0)
  • 2020-11-27 09:51

    I also had problems using libv8 and mini_racer. Resolved the problem with

    brew install v8
    
    bundle update libv8 mini_racer
    

    Using the latest versions mini_racer 0.2.10 and libv8 7.3.492.27 worked like a charm.

    0 讨论(0)
  • 2020-11-27 09:53

    I do not think you need therubyracer gem on windows. It is a javascript runtime using V8 engine. Hence it is making an attempt to install libv8.

    You can safely remove the gem from your Gemfile.

    Rails is happy to use which ever runtime it can find. execjs,nodejs etc. are all possible options.

    Microsoft already embeds JScript runtime for javascript on windows, and Rails uses it. See this for more

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