Avatar of bpfsr
bpfsrFlag for United States of America asked on

Where do I run RUBY?

I am reading the book Programming Amazon Web Services by James Murty. In the book he says "In this book we will demonstrate how to parse and create XML documents using the Ruby library called REXML." Then says "To demonstrate how to use this XPath in Ruby, we have saved the XML document to a file named example.xml, and we will use the REXML Ruby library to parse and query this document in an interactive Ruby session." And starts giving the following commands:

# Load the XML document text from a file
irb> xml_text = File.new('example.xml', 'r').read

# Load Ruby's XML handling library REXML
irb> require 'rexml/document'

# Parse the XML text in to a document object using REXML
irb> xml_doc = REXML::Document.new(xml_text)

# Define an XPath query string
irb> xpath = '/ListAllMyBucketsResult/Buckets/Bucket/Name'

# Perform the XPath query on the document and print the results
irb> xml_doc.elements.each(xpath) do |result|
irb>    puts result
irb> end
<Name>oreilly-aws</Name>
<Name>my-bucket</Name>

What I can't figure out is where I am running RUBY! I have RUBY 1.86.26 loaded on my computer cannot figure out where I'm entering the commands to get the thing to do the above. I wanted to program Amazon AWS, not learn RUBY! Any clue where I run this thing...???

RubyXMLAWS

Avatar of undefined
Last Comment
wesgarrison

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
blimster

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
SOLUTION
wesgarrison

Log in or sign up to see answer
Become an EE member today7-DAY FREE TRIAL
Members can start a 7-Day Free trial then enjoy unlimited access to the platform
Sign up - Free for 7 days
or
Learn why we charge membership fees
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
See how we're fighting big data
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
ask a question
ASKER
bpfsr

Okay, thanks guys - looks like that will work. Okay with you both if I split the points?
blimster

NEVER!!!!

lol alright beggers can't be choosers
wesgarrison

Ha!

Did we both help you?  If so, split the points.  If my suggestions didn't help, don't give me any points.
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy