Question : 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
oreilly-aws
my-bucket

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...???

Answer : Where do I run RUBY?

Ruby normally installs to C:\Program Files\ruby

Ruby are .rb scripts. So if you want to execute a Ruby Script then just name the file .rb and run it. You'll need Ruby and any associated ruby library to be installed to run.


The interactive Ruby console is located at: C:\ruby\bin\fxri.rbw

Normally a shortcut is placed in:
Start > All Programs > Ruby -[Version Number] > fxri - Interactive Ruby Help & Console

From the looks of it ensure you have REXML libraries installed before running those commands in the interactive console
Random Solutions  
 
programming4us programming4us