DEV Community

Andy Huynh
Andy Huynh

Posted on

1 2

LoadError: cannot load such file -- aws-sdk-core/plugins/http_checksum.rb

AWS Comprehend is in its early stages. The dev world is slowly seeing its potential. It's a struggle getting it set up with your Rails environment. The following resolved my problems. I hope it solves yours, too!

# app/models/clients/aws_comprehend.rb
class Clients::AwsComprehend
  def self.call
    Aws::Comprehend::Client.new(
      region: ENV.fetch("AWS_REGION"),
      access_key_id: ENV.fetch("AWS_ACCESS_KEY"),
      secret_access_key: ENV.fetch("AWS_SECRET_ACCESS_KEY")
    )
  end
end
Enter fullscreen mode Exit fullscreen mode
> Clients::AwsComprehend.()
=> NameError (uninitialized constant Aws::Comprehend::Client)
cannot load such file -- aws-sdk-core/plugins/http_checksum.rb
LoadError: cannot load such file -- aws-sdk-core/plugins/http_checksum.rb
Enter fullscreen mode Exit fullscreen mode

Solution

After digging online, this Github issue comment did the trick: https://github.com/aws/aws-sdk-ruby/issues/1872#issuecomment-461634704

> bundle update aws-sdk-s3
Enter fullscreen mode Exit fullscreen mode
> Clients::AwsComprehend.()
=> KeyError (key not found: "AWS_ACCESS_KEY")
Enter fullscreen mode Exit fullscreen mode

Obviously this is returns a different problem. However, updating aws-sdk-core to the latest will get you past the load error.

Image of Datadog

The Essential Toolkit for Front-end Developers

Take a user-centric approach to front-end monitoring that evolves alongside increasingly complex frameworks and single-page applications.

Get The Kit

Top comments (0)

Hostinger image

Get n8n VPS hosting 3x cheaper than a cloud solution

Get fast, easy, secure n8n VPS hosting from $4.99/mo at Hostinger. Automate any workflow using a pre-installed n8n application and no-code customization.

Start now

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay