therubyracer installation on windows with libv8 in

2019-06-26 05:26发布

I finally got libv8 installed on my windows with gem install libv8 -- --with-system-v8

now when I am trying to install therubyracer I get

gem install therubyracer
Temporarily enhancing PATH to include DevKit...
Building native extensions.  This could take a while...
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
        ERROR: Failed to build gem native extension.

        C:/Ruby193/bin/ruby.exe extconf.rb --with-system-v8
checking for main() in -lpthread... no
checking for v8.h... no
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of
necessary libraries and/or headers.  Check the mkmf.log file for more
details.  You may need configuration options.

Provided configuration options:
        --with-opt-dir
        --without-opt-dir
        --with-opt-include
        --without-opt-include=${opt-dir}/include
        --with-opt-lib
        --without-opt-lib=${opt-dir}/lib
        --with-make-prog
        --without-make-prog
        --srcdir=.
        --curdir
        --ruby=C:/Ruby193/bin/ruby
        --with-pthreadlib
        --without-pthreadlib
        --enable-debug
        --disable-debug
        --with-v8-dir
        --without-v8-dir
        --with-v8-include
        --without-v8-include=${v8-dir}/include
        --with-v8-lib
        --without-v8-lib=${v8-dir}/
C:/Ruby193/lib/ruby/gems/1.9.1/gems/libv8-3.16.14.3/ext/libv8/location.rb:50:in `configure': You hav
e chosen to use the version of V8 found on your system (Libv8::Location::System::NotFoundError)
and *not* the one that is bundle with the libv8 rubygem. However,
it could not be located. please make sure you have a version of
v8 that is compatible with 3.16.14.3 installed. You may
need to special --with-v8-dir options if it is in a non-standard
location

thanks,
The Mgmt

What I want to know is what this error message really means? Also I looked this up https://github.com/cowboyd/libv8#bring-your-own-v8 How do I install headers for v8?

3条回答
不美不萌又怎样
2楼-- · 2019-06-26 05:52

@Aalap

I ran into the same problem while setting up my Ruby on Rails web application on Windows 7 64-bit. I came across this solution. This is a bit old but solved the problem. This solution provides 'therubyracer' gem file and v8.dll libs to install. The instructions are pretty much clear on the link above.

I installed 'libv8' gem just like Periback's answer on SO and when I tried to install 'therubyracer' gem, it failed with same error as yours. Now my web application is running fine and my "gem list" command shows:

libv8 (3.11.8.13)

therubyracer (0.11.0beta1 x86-mingw32)

Hope this helps.

查看更多
成全新的幸福
3楼-- · 2019-06-26 05:56

When I faced this problem I found that I didn't need those gems in development, because rails use to precompile your assets, so my solution was pretty simple,

Gemfile

gem "rails"

group :production do
  gem 'therubyracer'
end

Then when you bundle run this command

$ bundle install --without production

Then smile to the life :D

查看更多
手持菜刀,她持情操
4楼-- · 2019-06-26 05:56

On Mac you can try updating the v8 library with homebrew:

gem uninstall libv8
brew install v8
gem install therubyracer

Update: Sorry, didn't realize this was a Windows only question.

查看更多
登录 后发表回答