首页 > 解决方案 > AWS:Ruby describe_instance_type_offerings() 给出异常:“未定义的方法”

问题描述

我使用了这个参考:AWS SDK for Ruby:describe_instance_type_offerings()

当我尝试实现这一点时,它给出了一个例外:

Undefined method

请指导我。

client = Aws::EC2::Client.new
resp = client.describe_instance_type_offerings(
    {
        dry_run: false,
        location_type: "region",
        filters: [
            {
                name: "location",
                values: ["us-east-1"],
            },
        ],
        max_results: 1,
        next_token: "NextToken",
    }
)

标签: ruby-on-railsamazon-web-servicesamazon-ec2

解决方案


请确保您使用的是最新版本的适用于 Ruby 的 AWS 开发工具包,因为此命令是最近才添加的。

虽然 API 是向后兼容的,但需要更新库以访问更新的函数和功能。


推荐阅读