NameError: uninitialized constant RUBY_DESCRIPTION

1,080 views
Skip to first unread message

Bryan S.

unread,
Jun 18, 2011, 12:59:14 PM6/18/11
to nokogi...@googlegroups.com
Hello,

I'm relatively new to ruby and completely new to nokogiri, so please bear with me.  I'm having trouble installing and using the nokogiri gem.  Below is my install:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.
C:\Documents and Settings\Bryan>ruby -v
ruby 1.8.6 (2008-08-11 patchlevel 287) [i386-mswin32]
C:\Documents and Settings\Bryan>gem -v
1.3.5
C:\Documents and Settings\Bryan>gem install nokogiri
Successfully installed nokogiri-1.4.5-x86-mswin32-60
1 gem installed
Installing ri documentation for nokogiri-1.4.5-x86-mswin32-60...
No definition for get_options
No definition for set_options
No definition for parse_memory
No definition for parse_file
No definition for parse_with
Installing RDoc documentation for nokogiri-1.4.5-x86-mswin32-60...
No definition for get_options
No definition for set_options
No definition for parse_memory
No definition for parse_file
No definition for parse_with
C:\Documents and Settings\Bryan>

After the install the following script (rsstest.rb) aborts

require 'rubygems'
 require 'nokogiri'
 require 'open-uri' 

doc = Nokogiri::HTML(open("http://www.threescompany.com/"
))
 

When I try to run it in irb I get the following error:

irb(main):001:0> require 'rubygems'
=> false
irb(main):002:0> require 'nokogiri'
NameError: uninitialized constant RUBY_DESCRIPTION
    from C:/Ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.5-x86-mswin32-60/lib/nokogiri/version.rb:12
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
    from C:/Ruby/lib/ruby/gems/1.8/gems/nokogiri-1.4.5-x86-mswin32-60/lib/nokogiri.rb:33
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `gem_original_require'
    from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:36:in `require'
    from (irb):2
    from ^C:0
irb(main):003:0>

I only get this error with Nokogiri. Simple-RSS and Hpricot both work, so I don't think it's a problem with rubygems in general.  I've looked around in this forum and online, but I've been unable to find anything useful.  I hope someone can help, Thanks!

-Bryan

Mike Dalessio

unread,
Jun 19, 2011, 9:17:01 PM6/19/11
to nokogi...@googlegroups.com
Hi,

Ah, can you try installing 1.4.4.1 please? This may be because Nokogiri 1.4.5 does not fully support Ruby 1.8.6, per deprecation plans announced a while ago. Try this:

   gem install nokogiri -v 1.4.4.1

To be honest, I'm now regretting the deprecation, and will try to fix 1.8.6 support and release a new 1.4 point version.
 
Simple-RSS and Hpricot both work, so I don't think it's a problem with rubygems in general.  I've looked around in this forum and online, but I've been unable to find anything useful.  I hope someone can help, Thanks!

-Bryan

--
You received this message because you are subscribed to the Google Groups "nokogiri-talk" group.
To view this discussion on the web visit https://groups.google.com/d/msg/nokogiri-talk/-/mr5pJnKeG1MJ.
To post to this group, send email to nokogi...@googlegroups.com.
To unsubscribe from this group, send email to nokogiri-tal...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/nokogiri-talk?hl=en.

Bryan S.

unread,
Jun 20, 2011, 10:14:48 AM6/20/11
to nokogiri-talk
Hello,

Thank you. I had trouble installing 1.4.4.1 due to an error with an
old version of rubygems and windows then found out the newest version
of rubygems had also been deprecated with 1.8.6. I've upgraded to
Ruby 1.9.2 and everything works fine.

Reply all
Reply to author
Forward
0 new messages