Select your cookie preferences

We use essential cookies and similar tools that are necessary to provide our site and services. We use performance cookies to collect anonymous statistics, so we can understand how customers use our site and make improvements. Essential cookies cannot be deactivated, but you can choose “Customize” or “Decline” to decline performance cookies.

If you agree, AWS and approved third parties will also use cookies to provide useful site features, remember your preferences, and display relevant content, including relevant advertising. To accept or decline all non-essential cookies, choose “Accept” or “Decline.” To make more detailed choices, choose “Customize.”

Installing the AWS SDK for Ruby

Focus mode
Installing the AWS SDK for Ruby - AWS SDK for Ruby

This section includes prerequisites and installation instructions for the AWS SDK for Ruby.

Prerequisites

Before you use the AWS SDK for Ruby, you must authenticate with AWS. For information about setting up authentication, see Authenticating the AWS SDK for Ruby with AWS.

Installing the SDK

You can install the AWS SDK for Ruby as you would any Ruby gem. The gems are available at RubyGems. The AWS SDK for Ruby is designed to be modular and is separated by AWS service. Installing the entire aws-sdk gem is large and may take over an hour.

We recommend only installing the gems for the AWS services you use. These are named like aws-sdk-service_abbreviation and the complete list is found in the Supported Services table of the AWS SDK for Ruby README file. For example, the gem for interfacing with the Amazon S3 service is directly available at aws-sdk-s3.

Ruby version manager

Instead of using system Ruby, we recommend using a Ruby version manager such as the following:

For example, if you are using an Amazon Linux 2 operating system, the following commands can be used to update RVM, list the available Ruby versions, then choose the version you want to use for development with the AWS SDK for Ruby. The minimum required Ruby version is 2.5.

$ rvm get head $ rvm list known $ rvm install ruby-3.1.3 $ rvm --default use 3.1.3

Bundler

If you use Bundler, the following commands install the AWS SDK for Ruby gem for Amazon S3:

  1. Install Bundler and create the Gemfile:

    $ gem install bundler $ bundle init
  2. Open the created Gemfile and add a gem line for each AWS service gem your code will use. To follow along with the Amazon S3 example, add the following line to the bottom of the file:

    gem "aws-sdk-s3"
  3. Save the Gemfile.

  4. Install the dependencies specified in your Gemfile:

    $ bundle install

On this page

PrivacySite termsCookie preferences
© 2025, Amazon Web Services, Inc. or its affiliates. All rights reserved.