# Newbie question - RESTful web service book

**URL:** <https://www.ruby-forum.com/t/newbie-question-restful-web-service-book/182750>\
**Category:** Ruby\
**Created:** [February 2, 2010, 10:03am UTC](https://www.ruby-forum.com/t/newbie-question-restful-web-service-book/182750 "2010-02-02T10:03:55Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![brianwisti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@brianwisti](https://www.ruby-forum.com/u/brianwisti)\
**Post date:** [February 2, 2010, 10:03am UTC](https://www.ruby-forum.com/t/newbie-question-restful-web-service-book/182750/1 "2010-02-02T10:03:55Z")

</div>

Hi,

I’m new to ruby, reading a book, “RESTful Web Services” by Richardson  
and Ruby  
On page 2,they have this:

#!/usr/bin/ruby -w

# amazon-book-search.rb

require ‘amazon/search’  
if ARGV.size != 2  
puts “Usage: #{$0} [Amazon Web Services AccessKey ID] [text to search  
for]”  
exit  
end  
access\_key, search\_request = ARGV  
req = Amazon::Search::Request.new(access\_key)

my question is what is "require ‘amazon/search’ " ?, It isnt defined in  
the book as far as I can see. The out program won’t run without it.

Thanks  
Brian

---

<div class="post-metadata">

**Author:** ![brianwisti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@brianwisti](https://www.ruby-forum.com/u/brianwisti)\
**Post date:** [February 2, 2010, 10:17am UTC](https://www.ruby-forum.com/t/newbie-question-restful-web-service-book/182750/2 "2010-02-02T10:17:04Z")

</div>

Brian W. wrote:

> Hi,
> 
> I’m new to ruby, reading a book, “RESTful Web Services” by Richardson  
> and Ruby  
> On page 2,they have this:
> 
> #!/usr/bin/ruby -w
> 
> # amazon-book-search.rb
> 
> require ‘amazon/search’  
> if ARGV.size != 2  
> puts “Usage: #{$0} [Amazon Web Services AccessKey ID] [text to search  
> for]”  
> exit  
> end  
> access\_key, search\_request = ARGV  
> req = Amazon::Search::Request.new(access\_key)
> 
> my question is what is "require ‘amazon/search’ " ?, It isnt defined in  
> the book as far as I can see. The out program won’t run without it.

Hello,

If you type this command, you will see all the gem packages available  
for amazon:

sudo gem list --remote | grep amazon

YOu choose he right one and then type:

sudo gem install

And you are done.

Regards,  
Pierre

> Thanks  
> Brian

---

<div class="post-metadata">

**Author:** ![brianwisti](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/b/fbc32d/32.png) [@brianwisti](https://www.ruby-forum.com/u/brianwisti)\
**Post date:** [February 2, 2010, 4:51pm UTC](https://www.ruby-forum.com/t/newbie-question-restful-web-service-book/182750/3 "2010-02-02T16:51:25Z")

</div>

Pierre Lecocq wrote:

> Brian W. wrote:
> 
> > Hi,
> > 
> > I’m new to ruby, reading a book, “RESTful Web Services” by Richardson  
> > and Ruby  
> > On page 2,they have this:
> > 
> > #!/usr/bin/ruby -w
> > 
> > # amazon-book-search.rb
> > 
> > require ‘amazon/search’  
> > if ARGV.size != 2  
> > puts “Usage: #{$0} [Amazon Web Services AccessKey ID] [text to search  
> > for]”  
> > exit  
> > end  
> > access\_key, search\_request = ARGV  
> > req = Amazon::Search::Request.new(access\_key)
> > 
> > my question is what is "require ‘amazon/search’ " ?, It isnt defined in  
> > the book as far as I can see. The out program won’t run without it.

Erf …

in fact, it is written in the book, 2 lines above the example you copied  
…  
([Ruby/Amazon](http://caliban.org/ruby/ruby-amazon.shtml))

Juste 2 lines.

> Hello,
> 
> If you type this command, you will see all the gem packages available  
> for amazon:
> 
> sudo gem list --remote | grep amazon
> 
> YOu choose he right one and then type:
> 
> sudo gem install
> 
> And you are done.
> 
> Regards,  
> Pierre
> 
> > Thanks  
> > Brian
