I am trying to follow the RailsCast to use Nokogiri.
Just a few very basic lines in my testing script file:
require 'rubygems'
require 'nokogiri'
require 'open-url'
url = "http://www.walmart.com/search/search-ng.do?search_constraint=0&ic=48_0&search_query=Batman&Find.x=0&Find.y=0&Find=Find"
doc = Nokogiri::HTML(open(url))
puts doc.at_css("title").text
But when I execute it, I run into an error:
/usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- open-url (LoadError)
from /usr/local/rvm/rubies/ruby-1.9.3-p392/lib/ruby/site_ruby/1.9.1/rubygems/core_ext/kernel_require.rb:54:in `require'
from nokogiri.test.rb:3:in `<main>'
I did install open url gem following this instruction:https://github.com/openurl/openurl How do I fix the error message?