【问题标题】:Rugged gem installation issue possibly with libgit2 on Windows坚固的 gem 安装问题可能与 Windows 上的 libgit2 有关
【发布时间】:2015-07-06 00:41:23
【问题描述】:

我使用的是 Windows,我的 Gemfile 有这行:

gem 'rugged'

当我运行 bundle install 时,它给了我这个错误:

Installing rugged 0.21.0 with native extensions

Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

    C:/Ruby21/bin/ruby.exe extconf.rb --use-system-libraries
    checking for cmake... no 
    ERROR: CMake is required to build Rugged.

*** 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:/Ruby21/bin/ruby

extconf failed, exit code 1

Gem files will remain installed in
C:/Ruby21/lib/ruby/gems/2.1.0/gems/rugged-0.21.0 for inspection.
Results logged to C:/Ruby21/lib/ruby/gems/2.1.0/extensions/x86-mingw32/2.1.0/rugged-0.21.0/gem_make.out

An error occurred while installing rugged(0.21.0), and Bundler cannot continue.

Make sure that `gem install rugged -v '0.21.0'` succeeds before
bundling.

我猜它与libgit2 有关,但我不确定。

【问题讨论】:

    标签: ruby windows gem


    【解决方案1】:

    这实际上是一个令我惊讶的问题,没有被问得更多。但是rugged 需要CMake & pkg-config 才能正确编译。

    因为我们可以,我们将它们提取到 DevKit 本身。

    首先让我们获取每个副本:

    CMake 相当简单,here's the download link.
    pkg-config 有点复杂,它有一些依赖关系等。但是,有一个nice package bundled with the dependencies

    然后解压合适的文件到DevKit

    拥有它们后,您需要打开每个存档 (requires 7-zip) 并打开存档中的 顶级 文件夹。
    从那里您需要将 binshare 目录从存档中提取到 DevKit 根目录中。
    它应该只是将目录合并到现有目录中,而不应该是任何内容被覆盖或删除。

    再次尝试安装,它应该正常工作,而且你不会用更多的东西弄脏你的PATH

    【讨论】:

    • 谢谢老兄..现在有一个新区域我卡住了..它与 Windows pc 上的 libv8 和 ruby​​racer 有关。
    • 如果不问另一个问题,应该在这里回答。
    • 谢谢老兄..现在有一个我卡住的新区域..它与 Windows pc 上的 libv8 和 ruby​​racer 有关。已经说了很多,比如stackoverflow.com/questions/19673714/…等等。但他们似乎没有工作。我尝试先运行 C:\Sooraj\Playdrone\playdrone-master>gem install libv8 -v '3.16.14.3' -- --with-system-v8 然后当我执行 bundle install 时出现以下错误stackoverflow.com/questions/31254645/…跨度>
    猜你喜欢
    • 2019-07-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-02-23
    • 1970-01-01
    相关资源
    最近更新 更多