Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

libv8 required python 2 to be installed in order to build - Windows [duplicate]

So this is how I try to install libv8 on my Windows:

D:\projects\perfstats>gem install libv8
Fetching: libv8-3.16.14.1.gem (100%)
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
ERROR:  Error installing libv8:
        ERROR: Failed to build gem native extension.

        D:/Ruby193/bin/ruby.exe extconf.rb
creating Makefile
The system cannot find the path specified.
The system cannot find the path specified.
The system cannot find the path specified.
D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/builder.rb:49:in `setup_python!': libv8 requires python 2 to be installed in order to build, but it is currently not available (RuntimeError)
        from D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/builder.rb:35:in `block in build_libv8!'
        from D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/builder.rb:34:in `chdir'
        from D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/builder.rb:34:in `build_libv8!'
        from D:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.1/ext/libv8/location.rb:24:in `install!'
        from extconf.rb:7:in `<main>'

I installed python 2.7 and added it to the path:

D:\projects\perfstats>python -V
Python 2.7.3

Any ideas what could be the solution in this case?

like image 436
user2192677 Avatar asked Jun 27 '13 15:06

user2192677


2 Answers

There are some work-around to fix the problem Try to run this: gem install libv8 -v '3.16.14.1' -- --with-system-v8

Or we separate them in the Gemfile like this

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

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

like image 55
Arman Ortega Avatar answered Sep 17 '22 13:09

Arman Ortega


I had the same problem trying to install the therubyracer gem on Windows.

Try installing the GitHub package therubyracer_for_windows and copy the v8.dll & v8preparser.dll into your ruby\bin folder.

This will also install the libv8 gem and should solve your issue.

like image 39
Martin Buberl Avatar answered Sep 16 '22 13:09

Martin Buberl