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
Brian Wolf 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 <the gem name>
And you are done.
Regards,
Pierre
···
Thanks
Brian
--
Posted via http://www.ruby-forum.com/\.
Pierre Lecocq wrote:
Brian Wolf 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
...
(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 <the gem name>
And you are done.
Regards,
Pierre
Thanks
Brian
--
Posted via http://www.ruby-forum.com/\.