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

后端 未结 16 1063
不思量自难忘°
不思量自难忘° 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:37

    Other workaround to fix the problem is to separate them in the Gemfile

    group :production do
     gem 'libv8', '~> 3.11.8.3'
     gem 'therubyracer', :platform => :ruby
    end
    

    And then run the bundle command: bundle install --without production

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

    Resolved libv8 3.16.14.7 issue using below command:

    gem install libv8 -v '3.16.14.7' -- --with-system-v8

    And then bundle install successfully completed.

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

    found this on github

    assuming you have tried the mentioned steps above, installed v8-315 and v8 via brew.

    brew unlink v8
    brew link --force v8-315
    gem install therubyracer -v '0.12.2' -- --with-system-v8
    
    0 讨论(0)
  • 2020-11-27 09:48

    try this one:

    gem install libv8 -v '3.16.14.3' -- --with-system-v8
    

    Note : Because libv8 is the interface for the V8 engine used by therubyracer, you may need to use libv8, even if you have V8 installed already. If you wish to use your own V8 installation, rather than have it built for you, use the --with-system-v8 option.

    For more you can go through the documentation of libv8 on github

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

    That works for me. Put that in your Gemfile

    gem 'libv8', '~>3.16.14.7'

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

    I tried the below commands on my local, it worked fine:

    brew install v8@3.15
    gem install libv8 -v 'YOUR_VERSION' -- --with-system-v8
    gem install therubyracer -v 'YOUR_VERSION' -- --with-v8-dir=/usr/local/opt/v8@3.15
    bundle install
    
    0 讨论(0)
提交回复
热议问题