Git Error installing package using Nokogiri: missing libxms2

I am following the Ruby on Rails Learn by Example from Michael Hatrl, but I am stuck halfway to chapter three due to an error. I was told to type: 'rails generate controller home contact pages'

where he answers: 'Could not find gem' webrat (= 0.7.1) 'in any of the gem sources listed in your Gemfile. Try running 'bundle install'

Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.0.1'

# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'

gem 'sqlite3-ruby', '1.3.2', :require => 'sqlite3'

group :development do
  gem 'rspec-rails', '2.5.0'
end

group :test do
  gem 'rspec', '2.5.0'
  gem 'webrat', '0.7.1'
end

# Use unicorn as the web server
# gem 'unicorn'

# Deploy with Capistrano
# gem 'capistrano'

# To use debugger
# gem 'ruby-debug'

# Bundle the extra gems:
# gem 'bj'
# gem 'nokogiri'
# gem 'sqlite3-ruby', :require => 'sqlite3'
# gem 'aws-s3', :require => 'aws/s3'

# Bundle gems for the local environment. Make sure to
# put test-only gems in this group so their generators
# and rake tasks are available in development mode:
# group :development, :test do
#   gem 'webrat'
# end

When I try to “install the package”, it lists the whole file, and when it comes to nokogiri, an error occurs. The main part of the error is:

Installing nokogiri (1.4.4) with native extensions
/usr/lib/ruby/site_ruby/1.8/rubygems/installer.rb:533:in 'build extensions': ERROR: 
Failed to build gem native extension. (Gem::Installer::ExtensionBuildError)

            /usr/bin/ruby.exe extconf.rb
checking for libxml/parser.h... no
-----
libxml2 is missing. please visit http://nokogiri.org/tutorials/installing_nokogiri.html
for help with installing dpenedencies.
-----
*** 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 details. You may need configuration options.

Please help me finish the whole book quickly, and this high-speed album slows me down = (

Edit: I am using Git on Windows 7

+5
6

, ipsum:

Debian Ubuntu "libxml2-dev".

sudo apt-get install libxml2-dev

:

sudo apt-get install libxslt-dev
+11

Windows 7:

"libxml2 missing" , Cygwin setup.exe ( "lib" ).

DevKit rubyonrails.org .

+1

Debian Ubuntu, libxml2-dev. (sudo apt-get install libxml2-dev).

0

On Mac OSX, try just uninstall libxml2. * lib files from opt / local / lib, as described here. Errors installing some stones on Snow Leopard - libxml2 .

It worked for me.

0
source

I had this problem in OSX when installing github pages. All I had to do was install libxml2 and libxslt using brew.

brew install libxml2 libxslt

After these libraries were installed, I pointed out to link to use my system libraries when installing nokogiri:

bundle config build.nokogiri --use-system-libraries

and then I run:

bundle install
0
source

All Articles