我有以下文件结构
xml_parse
- files
-sitemap
- parse_sitemap.rb
以下是parse_sitemap.rb中的代码
require 'nokogiri'
require './files/sitemap'
doc = Nokogiri::XML(File.open('./files/sitemap'))
puts doc.xpath("//loc")
这是错误
/home/vamsi/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require': cannot load such file -- ./files/sitemap (LoadError)
from /home/vamsi/.rbenv/versions/2.3.1/lib/ruby/2.3.0/rubygems/core_ext/kernel_require.rb:55:in `require'
from parse_sitemap.rb:2:in `<main>'