简体   繁体   English

在安装Opengraph Gem时出错

[英]Getting errors while installing Opengraph Gem

I get the following error when I try to install the opengraph gem: 尝试安装opengraph gem时出现以下错误:

gem install opengraphBuilding native extensions.  This could take a while...
ERROR:  Error installing opengraph:
    ERROR: Failed to build gem native extension.

details.  You may need configuration options.

Provided configuration options:
    --with-opt-dir
    --without-opt-dir
    --with-xslt-dir
    --without-xslt-dir
    --with-xslt-include
    --without-xslt-include=${xslt-dir}/include
    --with-xslt-lib
    --without-xslt-lib=${xslt-dir}/lib


Gem files will remain installed in /home/faraz/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7 for inspection.
Results logged to /home/faraz/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out

Here is my setup: 这是我的设置:

  • OS: Linux Mint 64bit. 操作系统:Linux Mint 64bit。
  • Ruby: 1.9.3 红宝石:1.9.3
  • Rails 3.2.3 Rails 3.2.3
  • Rubygems: 2.1.0 红宝石:2.1.0

Please help. 请帮忙。

EDIT 编辑

As asked in the answer below, here are the logs from /home/faraz/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out : 如下面的答案所述,这是/home/faraz/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out中的日志:

....../bin/ruby extconf.rb extconf.rb:10: Use RbConfig instead of obsolete and deprecated Config.
checking for libxml/parser.h... yes
checking for libxslt/xslt.h... no
 ----- libxslt is missing

There are some other lines like this in the log file. 日志文件中还有其他类似的行。

From the above log, it should be clear that opengraph installation failed because nokigiri installation failed. 从上面的日志中,应该清楚,由于nokigiri安装失败,opengraph安装失败。 You should next open /home/faraz/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out and tell us the error logged there. 接下来,您应该打开/home/faraz/.rvm/gems/ruby-1.9.3-p448/gems/nokogiri-1.4.7/ext/nokogiri/gem_make.out并告诉我们那里记录的错误。 I have a hunch that you don't have xml tools on your machine. 我有一种直觉,即您的机器上没有xml工具。 Log messages from that file will confirm it. 来自该文件的日志消息将对其进行确认。

To install nokogiri, you need to have some packages installed already: Run the following command to install them now: 要安装nokogiri,您需要已经安装了一些软件包:运行以下命令以立即安装它们:

sudo apt-get install libxslt1-dev libxml2-dev

After that, run gem install nokogiri and if there are any errors, please report them again. 之后,执行gem install nokogiri ,如果有任何错误,请再次报告。 If not, you can go back to installing opengraph. 如果没有,您可以返回安装opengraph。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM