Sitelet https://github.com/aws/aws-sdk-ruby/issues/604
Skip to content

traceback from AWS::Core::CredentialProviders::SharedCredentialFileProvider under Ruby 1.8.7 #604

Description

@hakamadare

I'm seeing an issue with aws-sdk 1.51.0 under Ruby 1.8.7. The following code demonstrates it:

#!/usr/bin/env ruby

require 'rubygems'
require 'aws-sdk'

iam = AWS::IAM.new(
  :credential_provider => AWS::Core::CredentialProviders::SharedCredentialFileProvider.new
  )

iam.users['<SOME IAM USER>']

This code generates the following traceback when run under Ruby 1.8.7:

/var/lib/gems/1.8/gems/aws-sdk-1.51.0/lib/aws/core/credential_providers.rb:278:in
`initialize': undefined method `home' for Dir:Class (NoMethodError)
        from /tmp/aws-sdk-test.rb:7:in `new'
        from /tmp/aws-sdk-test.rb:7

It looks like the fundamental issue is that there is no Dir.home method in that version of Ruby; it's only in 1.9.x and later. I can work around the issue by passing a :path to SharedCredentialFileProvider, but it would be nice if this worked out of the box (or alternately, enforce the dependency on Ruby 1.9.x in the Gemfile, but that's unfortunate for people using the system Ruby).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions