Ruby Libraries for Amazon Web Services

Sample Code & Libraries>SDKs>Ruby Libraries for Amazon Web Services
Community Contributed Software

  • Amazon Web Services provides links to these packages as a convenience for our customers, but software not authored by an "@AWS" account has not been reviewed or screened by AWS.
  • Please review this software to ensure it meets your needs before using it.

The Libraries for Amazon Web Services is an open source RubyForge project containing a set of libraries and tools designed to make it easier for you to build solutions leveraging Amazon Mechanical Turk in Ruby.

Details

Submitted By: JohnM@AWS
AWS Products Used: Amazon Mechanical Turk
Language(s): Ruby
License: Apache License 2.0
Source Control Access: svn checkout http://ruby-aws.rubyforge.org/svn/trunk/
Created On: May 31, 2007 3:55 AM GMT
Last Updated: February 6, 2013 11:19 PM GMT
Download

About this Library

The Libraries for Amazon Web Services are a set of libraries and tools designed to make it easier for you to build solutions leveraging Amazon Mechanical Turk. The goals of the Libraries are:

  • To abstract you from the "muck" of using web services
  • To simplify using the various Amazon Mechanical Turk APIs
  • To allow you to focus more on solving the business problem and less on managing technical details

About the Open Source Project

Visit the Libraries for Amazon Web Services project homepage.

We believe that the developer community is an integral part of making Mechanical Turk easier to use for everyone. Releasing our code to the open source community is the first step in creating an environment of innovation and collaboration with our customers.

Usage

    require 'ruby-aws'
    @mturk = Amazon::WebServices::MechanicalTurkRequester.new
    puts "I have $#{@mturk.availableFunds} in Sandbox"
    @mturk_prod = Amazon::WebServices::MechanicalTurkRequester.new :Host => :Production
    puts "I have $#{@mturk.availableFunds} in Production"
    
For more in-depth example code, check out the samples folder included in the distribution.

Prerequisites

To use the Libraries and successfully run the samples, you must meet these prerequisites:
  • You must have an Amazon Web Services (AWS) account. You can sign up at the AWS web site.
  • You must have an Amazon Mechanical Turk Requester account. Be sure to use the same e-mail address and password you used when creating your Amazon Web Services account. You can sign up at the Requester web site.
  • You must have Ruby 1.8.2 or later. You can download Ruby at the following web site: http://www.ruby-lang.org.
  • You must have RubyGems installed and configured correctly for your Ruby installation. Review the installation instructions here.
    (Note: If installing RubyGems for the first time, you may need to restart your console to pick up environment changes. To execute code that is dependent on Ruby Gems, the command to execute is:

    ruby -rubygems program_that_uses_gems

    The "-rubygems" command line parameter should be a default parameter that is always included. To do this, Ruby can utilize the "RUBYOPT" environment label that should be set to "RUBYOPT=-rubygems". Please refer to documentation specific to your OS on defining environment labels.)

Installation

  1. Execute the following command:

    gem install ruby-aws

    (Note: Some Unix-based systems may require root access to install Ruby libraries. You may need to execute the above command as the following:

    sudo gem install ruby-aws

    and enter in the password to successfully install the Gem)
  2. Installation of the ruby-aws gem will prompt to install the following dependent gems if not already installed:
  3. (Optional) Download and expand the corresponding tarball/zip file from the project homepage to an installation directory. This will provide you access to the source files, test files and sample code.
  4. Configure the Libraries to use your Amazon Web Services authentication credentials by executing the following command:

    ruby-aws

  5. Verify your installation by running the automated tests by executing the following command in the installation path:

    rake test

Running Sample Applications

  1. Navigate to the samples\mturk directory of the installation path.
  2. Run the various samples

Comments, Questions or Feedback

If you have any comments, questions, or feedback concerning the Libraries for Amazon Web Services, please visit our RubyForge project page. If you have any comments, questions, or feedback concerning the Mechanical Turk service in general, please visit the Amazon Mechanical Turk discussion forums

Comments

Doesnot Work!
PS @All - This does not work for ruby 1.9!! Lots of bugs!
abracadabra123321 on July 2, 2010 8:02 PM GMT
Good Stuff with a typo that made me feel rich
This is pretty cool! Two small things that bit me, first the need to find and run ruby-aws (on non-windows system it is not necessarily in the path after installation). I would rather prefer a config file over the need to enter stuff interactively. The second thing that made me feel rich was the typo in the sample code: require 'ruby-aws' @mturk = Amazon::WebServices::MechanicalTurkRequester.new puts "I have $#{@mturk.availableFunds} in Sandbox" @mturk_prod = Amazon::WebServices::MechanicalTurkRequester.new :Host => :Production puts "I have $#{@mturk.availableFunds} in Production" it should be: require 'ruby-aws' @mturk = Amazon::WebServices::MechanicalTurkRequester.new puts "I have $#{@mturk.availableFunds} in Sandbox" @mturk_prod = Amazon::WebServices::MechanicalTurkRequester.new :Host => :Production puts "I have $#{@mturk_prod.availableFunds} in Production" Thanks for the good stuff
Syed A. Rizvi on August 8, 2007 2:31 PM GMT
We are temporarily not accepting new comments.
©2014, Amazon Web Services, Inc. or its affiliates. All rights reserved.