Can't install libv8 3.11.8.17 in Rails on Windows
Asked Answered
A

2

6

Can't install libv8 3.11.8.17 gem. I already looked around and found out that it doesn't support Windows. Though I'm still looking for a workaround?

Installing libv8 (3.11.8.17)
Gem::Installer::ExtensionBuildError: ERROR: Failed to build gem native extension.

C:/RailsInstaller/Ruby1.9.3/bin/ruby.exe extconf.rb
creating Makefile
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
Das System kann den angegebenen Pfad nicht finden.
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-            
3.11.8.17/ext/libv8/builder.rb:49:in `setup_python!': libv8 requires python 2 to b
e installed in order to build, but it is currently not available (RuntimeError)
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-
3.11.8.17/ext/libv8/builder.rb:35:in `block in build_libv8!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-
3.11.8.17/ext/libv8/builder.rb:34:in `chdir'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-
3.11.8.17/ext/libv8/builder.rb:34:in `build_libv8!'
from C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-
3.11.8.17/ext/libv8/location.rb:24:in `install!'
from extconf.rb:7:in `<main>'

Gem files will remain installed in 
C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-3.11.8.17 for inspection.
Results logged to C:/RailsInstaller/Ruby1.9.3/lib/ruby/gems/1.9.1/gems/libv8-
3.11.8.17/ext/libv8/gem_make.out
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.

I don't try to use therubyracer, and honestly don't know what gem depends on libv8. Installing Python27 and setting PATH didn't do anything. Anything I can do other than changing platforms? Or maybe there is a workaround with the v8.dll available from https://github.com/hiranpeiris/therubyracer_for_windows that I don't seem to grasp?

Antony answered 21/6, 2013 at 14:12 Comment(1)
Adding: I work with other developers, they are on OS X and prob don't have that problem, so cutting out libv8 may not be an option :/Antony
M
4

Try this

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

Answer from here

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

Marienbad answered 23/11, 2013 at 1:5 Comment(1)
Thanks This fixed my problemDiscretion
T
3

I'm using libV8 and TheRubyRacer on prod only in my Linux environment. I separate them in the Gemfile:

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

Then I bundle install without production:

bundle install --without production

(See SO article: Why does 'bundle' install production gems on my development machine?)

This seems to avoid the whole V8 debate on Windows.

Topsyturvydom answered 27/8, 2013 at 17:17 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.