简体   繁体   中英

Getting errors while installing Opengraph Gem

I get the following error when I try to install the 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.
  • Ruby: 1.9.3
  • Rails 3.2.3
  • Rubygems: 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 :

....../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. 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. I have a hunch that you don't have xml tools on your machine. 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:

sudo apt-get install libxslt1-dev libxml2-dev

After that, run gem install nokogiri and if there are any errors, please report them again. If not, you can go back to installing opengraph.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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