gpt4 book ai didi

ruby-on-rails - 无法使用 Rubber 连接到 ec2

转载 作者:太空宇宙 更新时间:2023-11-03 16:54:05 24 4
gpt4 key购买 nike

我正在尝试使用 Rubber gem 将我的 Rails 应用程序上传到 amazon ec2(我正在关注 Railscasts tutorial)。每次运行 cap rubber:create_staging 时,我都无法连接到服务器。我一直在尽一切可能让它工作,但经过一整天的尝试后,我想我应该在这里发布发生的事情。

Andrews-MacBook-Pro:blog andrew$ cap rubber:create_staging
Respawning with 'bundle exec'
triggering load callbacks
* 2013-01-03 17:27:20 executing `rubber:init'
* 2013-01-03 17:27:23 executing `rubber:create_staging'
Hostname to use for staging instance [production]:
Roles to use for staging instance [apache,app,collectd,common,db:primary=true,elasticsearch,examples,graphite_server,graphite_web,graylog_elasticsearch,graylog_mongodb,graylog_server,graylog_web,haproxy,mongodb,monit,passenger,postgresql,postgresql_master,web,web_tools]:
* 2013-01-03 17:27:26 executing `rubber:create'
* Security Group already in cloud, syncing rules: blog_production_production
* Security Group already in cloud, syncing rules: blog_production_graylog_mongodb
* Security Group already in cloud, syncing rules: blog_production_mongodb
* Security Group already in cloud, syncing rules: blog_production_postgresql
* Security Group already in cloud, syncing rules: blog_production_postgresql_master
* Security Group already in cloud, syncing rules: blog_production_db
* Security Group already in cloud, syncing rules: blog_production_app
* Security Group already in cloud, syncing rules: blog_production_web
* Security Group already in cloud, syncing rules: blog_production_haproxy
* Security Group already in cloud, syncing rules: blog_production_elasticsearch
* Security Group already in cloud, syncing rules: blog_production_monit
* Security Group already in cloud, syncing rules: blog_production_common
* Security Group already in cloud, syncing rules: blog_production_default
* Security Group already in cloud, syncing rules: blog_production_graylog_elasticsearch
* Security Group already in cloud, syncing rules: blog_production_apache
* Security Group already in cloud, syncing rules: blog_production_passenger
* Security Group already in cloud, syncing rules: blog_production_examples
* Security Group already in cloud, syncing rules: blog_production_graphite_web
* Security Group already in cloud, syncing rules: blog_production_graphite_server
* Security Group already in cloud, syncing rules: blog_production_graylog_server
* Security Group already in cloud, syncing rules: blog_production_collectd
* Security Group already in cloud, syncing rules: blog_production_graylog_web
* Security Group already in cloud, syncing rules: blog_production_web_tools
** Creating instance ami-eafa5883/m1.small/blog_production_default,blog_production_web,blog_production_web_tools,blog_production_production,blog_production_apache,blog_production_app,blog_production_passenger,blog_production_collectd,blog_production_common,blog_production_monit,blog_production_db,blog_production_postgresql,blog_production_postgresql_master,blog_production_elasticsearch,blog_production_examples,blog_production_graphite_server,blog_production_graphite_web,blog_production_graylog_elasticsearch,blog_production_graylog_mongodb,blog_production_mongodb,blog_production_graylog_server,blog_production_graylog_web,blog_production_haproxy/Default
** Instance production created: i-7b4f840a
Waiting for instances to start..........................
** Instance running, fetching hostname/ip data
* 2013-01-03 17:28:37 executing `rubber:_allow_root_ssh'
* executing "sudo -p 'sudo password: ' bash -l -c 'cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
servers: ["23.20.130.97"]
.... ** Failed to connect to 23.20.130.97, retrying
* 2013-01-03 17:28:44 executing `rubber:_allow_root_ssh'
* executing "sudo -p 'sudo password: ' bash -l -c 'cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
servers: ["23.20.130.97"]
. ** Failed to connect to 23.20.130.97, retrying
* 2013-01-03 17:28:46 executing `rubber:_allow_root_ssh'
* executing "sudo -p 'sudo password: ' bash -l -c 'cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
servers: ["23.20.130.97"]
. ** Failed to connect to 23.20.130.97, retrying
* 2013-01-03 17:28:49 executing `rubber:_allow_root_ssh'
* executing "sudo -p 'sudo password: ' bash -l -c 'cp /home/ubuntu/.ssh/authorized_keys /root/.ssh/'"
servers: ["23.20.130.97"]

etc

然后它似乎进入了无限循环并每隔几分钟尝试连接到服务器,如上所示。

编辑: 我最终通过在本地机器上重新安装 ruby​​ + gems 解决了这个问题。仍然不确定是什么原因造成的。

最佳答案

这实际上是因为当您在 EC2 上创建实例时,即使创建了实例(并且您可以在 AWS 管理控制台上看到绿灯),它仍然需要一些时间来传播 IP 地址以供您访问部署机。

真正的解决方案是等待几分钟,因为它最终会连接。

关于ruby-on-rails - 无法使用 Rubber 连接到 ec2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14134141/

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