【问题标题】:How to get libv8 gem installed on Windows with Ruby 2.0?如何使用 Ruby 2.0 在 Windows 上安装 libv8 gem?
【发布时间】:2023-04-01 08:30:01
【问题描述】:

我正在尝试让 Devise 工作,似乎它需要 therubyracer gem。这需要 libv8 gem。我收到一个错误,它找不到 python2,所以我安装了 python 2.7 并将 python.exe 复制到 python2.exe... 并将 C:\Python27 添加到我的路径中。然后它在抱怨:

$ gem install therubyracer
Building native extensions.  This could take a while...
ERROR:  Error installing therubyracer:
        ERROR: Failed to build gem native extension.

    c:/Ruby200-x64/bin/ruby.exe extconf.rb
creating Makefile
  File "<string>", line 1
    'import
          ^
SyntaxError: EOL while scanning string literal
  File "<string>", line 1
    'import
          ^
SyntaxError: EOL while scanning string literal
/bin/sh: C:devbinmake.EXE: command not found
C:\dev\bin\make.EXE: *** [x64.release] Error 127
c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:36:in `block in verify_installation!': libv8 did not install properly, expected binary v8 archive 'c:/
Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17/vendor/v8/out/x64.release/obj.target/tools/gyp/libv8_base.a'to exist, but it was not found (Libv8::Location::Vendor::ArchiveNot
Found)
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `each'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:35:in `verify_installation!'
        from c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17/ext/libv8/location.rb:26:in `install!'
        from extconf.rb:7:in `<main>'
Compiling v8 for x64
Using python
Using compiler: C:\dev\mingw\bin\g++.EXE
GYP_GENERATORS=make \
        build/gyp/gyp --generator-output="out" build/all.gyp \
                      -Ibuild/standalone.gypi --depth=. \
                      -Dv8_target_arch=x64 \
                      -S.x64  -Dv8_can_use_vfp_instructions=true


Gem files will remain installed in c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17 for inspection.
Results logged to c:/Ruby200-x64/lib/ruby/gems/2.0.0/gems/libv8-3.11.8.17/ext/libv8/gem_make.out

【问题讨论】:

    标签: ruby devise ruby-2.0 therubyracer libv8


    【解决方案1】:

    您可以在 Windows 上安装较早版本的 libv8,但显然 ruby​​racer 使用 3.11.8.5

    gem install libv8 -v 3.11.8
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-07-28
      • 2013-07-10
      • 1970-01-01
      • 2013-11-03
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多