After listening to Rails Cast No 190 I sat down to try it
So I installed nokogiri with
gem install nokogiri
on my Windows 7 Ultimate laptop. I use Ruby 1.9
and this is the way i Installed Nokogiri
C:\Ruby>gem install nokogiri
Successfully installed nokogiri-1.4.2-x86-mingw32
1 gem installed
Installing ri documentation for nokogiri-1.4.2-x86-mingw32...
Updating class cache with 1221 classes...
Installing RDoc documentation for nokogiri-1.4.2-x86-mingw32...
Now for the following code hello.rb
require 'rubygems'
require 'nokogiri'
require 'open-uri'
url = "http://timesofindia.indiatimes.com/rssfeeds/-2128838597.cms"
doc = Nokogiri::HTML(open(url))
puts doc.at_css("title").text
I tried to get a result in the form of Title but I am getting the following error!!
C:\Ruby>ruby hello.rb
C:/Ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2-x86-mingw32/lib/nokogiri/nokogir
i.rb:1:in `require': 127: The specified procedure could not be found. - Init_n
okogiri (LoadError)
C:/Ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2-x86-mingw32/lib/nokogiri/1.9/nok
ogiri.so
from C:/Ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2-x86-mingw32/lib/nok
ogiri/nokogiri.rb:1:in `<top (required)>'
from C:/Ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2-x86-mingw32/lib/nok
ogiri.rb:13:in `require'
from C:/Ruby/lib/ruby/gems/1.9.1/gems/nokogiri-1.4.2-x86-mingw32/lib/nok
ogiri.rb:13:in `<top (required)>'
from hello.rb:2:in `require'
from hello.rb:2:in `<main>'
I have tried to uninstall and reinstall with gem uninstall nokogiri
but still i cant get rid of the error.
Please help me to fix it!!
Thanks
Gautam