gem 无法安装 bropages

gem 无法安装 bropages

有一款替代手册页文档软件,名为 bropages,用 ruby​​ 编写,我想安装它。我按照网站,但出现以下错误:

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

    /usr/bin/ruby2.1 mkrf_conf.rb
Building native extensions.  This could take a while...
/usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:89:in `run': ERROR: Failed to build gem native extension. (Gem::Ext::BuildError)

    /usr/bin/ruby2.1 extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/unf-0.2.0.beta2/ext/gems/gems/unf_ext-0.0.7.1 for inspection.
Results logged to /var/lib/gems/2.1.0/gems/unf-0.2.0.beta2/ext/gems/extensions/x86_64-linux/2.1.0/unf_ext-0.0.7.1/gem_make.out
    from /usr/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:38:in `block in build'
    from /usr/lib/ruby/2.1.0/tempfile.rb:324:in `open'
    from /usr/lib/ruby/2.1.0/rubygems/ext/ext_conf_builder.rb:17:in `build'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:161:in `block (2 levels) in build_extension'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `chdir'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:160:in `block in build_extension'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `synchronize'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:159:in `build_extension'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:198:in `block in build_extensions'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `each'
    from /usr/lib/ruby/2.1.0/rubygems/ext/builder.rb:195:in `build_extensions'
    from /usr/lib/ruby/2.1.0/rubygems/installer.rb:677:in `build_extensions'
    from /usr/lib/ruby/2.1.0/rubygems/installer.rb:232:in `install'
    from /usr/lib/ruby/2.1.0/rubygems/resolver/specification.rb:78:in `install'
    from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:206:in `block in install_into'
    from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:198:in `each'
    from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:198:in `install_into'
    from /usr/lib/ruby/2.1.0/rubygems/request_set.rb:119:in `install'
    from /usr/lib/ruby/2.1.0/rubygems/dependency_installer.rb:389:in `install'
    from mkrf_conf.rb:15:in `<main>'

rake failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.1.0/gems/unf-0.2.0.beta2 for inspection.
Results logged to /var/lib/gems/2.1.0/extensions/x86_64-linux/2.1.0/unf-0.2.0.beta2/gem_make.out

我对 Ruby 宝石并不熟悉,而且我没有看到任何明确指出错误的东西。那么这里出了什么问题?我该如何安装 bropages?

我尝试过sudo apt-get install bro但那完全是另一回事。

答案1

您可能缺少编译模块时所需的 ruby​​ 头文件。

如果你使用的是 Debian/Ubuntu,请使用以下命令安装它们:

sudo apt-get install ruby-dev

然后再次尝试安装 bropages。

答案2

你可能缺少编译此 gem 所需的本机依赖项所需的一些文件

尝试运行以下命令

sudo apt-get update
sudo apt-get install ruby2.1-dev

此后,尝试再次安装 bropages gem,看看错误是否消失或改变

答案3

就我而言,我需要安装依赖项。

来自文档

sudo apt-get install cmake make gcc g++ flex bison libpcap-dev libssl-dev python-dev swig zlib1g-dev

相关内容