"uninitialized constant Nokogiri (NameError)"

Y

Yooakim

I'm trying a very simple Ruby program:

require 'nokogiri'

doc = Nokogiri::XML(File.open("Alla.xml"))


Whenever I run this I get "uninitialized constant Nokogiri
(NameError)"

Nokogiri is installed as far as I know, here's my "gem list" output:

c:\dev>gem list

*** LOCAL GEMS ***

fxri (0.3.7, 0.3.6)
fxruby (1.6.19, 1.6.12)
hpricot (0.8.1, 0.6)
log4r (1.0.5)
nokogiri (1.2.3)
ptools (1.1.6)
rake (0.8.4, 0.7.3)
rubygems-update (1.3.2)
sources (0.0.1)
test-unit (2.0.2)
win32-api (1.4.0, 1.0.4)
win32-clipboard (0.4.4, 0.4.3)
win32-dir (0.3.3, 0.3.2)
win32-eventlog (0.5.0, 0.4.6)
win32-file (0.6.1, 0.5.4)
win32-file-stat (1.3.3, 1.2.7)
win32-process (0.6.0, 0.5.3)
win32-sapi (0.1.4)
win32-sound (0.4.1)
windows-api (0.3.0, 0.2.0)
windows-pr (1.0.2, 0.7.2)


I would be very glad if anyone could help me find out why this doesn't
work?

I'm a seasoned computer user but new to Ruby... so any pointers are
welcome. I'm using Ruby 1.8.6

c:\dev>ruby --version
ruby 1.8.6 (2007-09-24 patchlevel 111) [i386-mswin32]


Cheers,
Joakim
 
G

Gregory Brown

I'm trying a very simple Ruby program:

=A0require 'nokogiri'

=A0doc =3D Nokogiri::XML(File.open("Alla.xml"))

try:

require "rubygems"
require "nokogiri"

#...

On Ruby 1.8.x, Rubygems needs to be explicitly enabled.

-greg
 
E

Eric Hodel

I'm trying a very simple Ruby program:

require 'nokogiri'

doc = Nokogiri::XML(File.open("Alla.xml"))


Whenever I run this I get "uninitialized constant Nokogiri
(NameError)"

Let me guess, you named your program 'nokogiri.rb', don't do that.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,059
Latest member
cryptoseoagencies

Latest Threads

Top