gpt4 book ai didi

ruby-on-rails - 橡胶 2(雾)和 key 对错误

转载 作者:行者123 更新时间:2023-12-04 01:18:54 26 4
gpt4 key购买 nike

嗨,我正在尝试使用 ec2 的rubber gem,但在快速入门部分遇到一些问题。由于某种原因,橡胶下的雾没有找到 key 对。这是详细信息:

在 irb 中(这里的路径是我的 Rubber.yml key_file 属性中的内容——gsg-keypair 是我的私钥,没有 pem 扩展名,它的公钥在同一个目录中):

1.9.3p125 :010 > File.open("#{Dir[(File.expand_path('~') rescue '/root') + '/.ec2/*'].first}")


=> #<File:/home/charlie/.ec2/gsg-keypair>

但是每次我运行时: cap Rubber:create_staging 接受所有默认值我得到这个:
/home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/excon-0.15.4/lib/excon/connection.rb:276:in `request_kernel': The key pair 'gsg-keypair' does not exist (Fog::Compute::AWS::NotFound)
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/excon-0.15.4/lib/excon/connection.rb:105:in `request'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/fog-1.5.0/lib/fog/core/connection.rb:20:in `request'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/fog-1.5.0/lib/fog/aws/compute.rb:368:in `request'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/fog-1.5.0/lib/fog/aws/requests/compute/run_instances.rb:117:in `run_instances'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/fog-1.5.0/lib/fog/aws/models/compute/server.rb:182:in `save'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/fog-1.5.0/lib/fog/core/collection.rb:50:in `create'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/rubber-2.0.5/lib/rubber/cloud/fog.rb:27:in `create_instance'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/rubber-2.0.5/lib/rubber/thread_safe_proxy.rb:13:in `method_missing'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/rubber-2.0.5/lib/rubber/recipes/rubber/instances.rb:295:in `create_instance'
from /home/charlie/.rvm/gems/ruby-1.9.3-p125@bag/gems/rubber-2.0.5/lib/rubber/recipes/rubber/instances.rb:215:in `block (2 levels) in create_instances'

知道为什么会这样吗?

谢谢
查理

最佳答案

我刚刚经历了这个,这是错误的:

在rubber.yml 文件中,我有:region: us-east-1
但是,当我在 AWS 控制台中创建我的 key 对时,我在不同的区域。
您必须在与 Rubber.yml 文件中指定的相同区域中创建 key 对。

enter image description here

希望这可以帮助!

关于ruby-on-rails - 橡胶 2(雾)和 key 对错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11762401/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com