Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3304098
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T21:01:34+00:00 2026-05-17T21:01:34+00:00

I have a two line script that works nicely in ruby. I moved it

  • 0

I have a two line script that works nicely in ruby. I moved it to haml and getting the error

NameError at /
uninitialized constant Tilt::CompileSite::Nokogiri

the haml code:

      %td
        - @doc = Nokogiri::XML(File.open(file))
        = @doc.xpath("//testsuite").each_with_index {|node,index| "#{index+1}. #{node.attributes["name"].value}<BR>" }

any idea how I can make it work?

using below on Win XP SP3

  • ruby 1.8.7 (2010-08-16 patchlevel 302) [i386-mingw32]
  • nokogiri (1.4.3.1 x86-mingw32)
  • sinatra (1.0)
  • thin (1.2.7 x86-mswin32)
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-17T21:01:35+00:00Added an answer on May 17, 2026 at 9:01 pm

    still do not know why the error happens but I solved it by have a function defined in sinatra file and calling it in haml file = get_testsuite(file)

    def get_testsuite (file)
    
      @doc = Nokogiri::XML(File.open(file))
      output = Array.new
      @doc.xpath("//testsuite").each_with_index {|node,index|
        output << "#{index+1}. #{node.attributes["name"].value}<BR>"
      }
      return output
    end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MSBuild script that uses NUnit to run tests in two assemblies.
I have two points (a line segment) and a rectangle. I would like to
I want to have two items on the same line using float: left for
I have two applications written in Java that communicate with each other using XML
I have a very simple perl script that moves files (don't ask why i
I have two (UNIX) programs A and B that read and write from stdin/stdout.
I've got a script that calls two functions, A and B, from the same
I have a bash script that I am run to check to see if
I have a java CLI script that converts rgb names to hexcodes (e.g. 144
Greetings. I have written a little python script that calls MySQL in a subprocess.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.