- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试使用 padrino 为我的亚马逊环境构建一个仪表板。但是当我在 Controller 中尝试以下代码时:
get :index, :map => "/" do
AWS.config(access_key_id: 'ACCESS_KEY',
secret_access_key: 'secret_access_key',
region: 'ap-southeast-2')
ec2 = AWS::EC2.new
response = ec2.client.describe_instances(:instance_ids => ['instance_id'])
@instance = response[:reservation_set].first[:instances_set].first
render 'index'
end
我遇到了以下错误:
SocketError - getaddrinfo: nodename nor servname provided, or not known:
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:in initialize'
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:inopen'
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:877:in block in connect'
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/timeout.rb:66:intimeout'
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:876:in connect'
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:862:indo_start'
/Users/mymac/.rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/net/http.rb:857:in start'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/http/connection_pool.rb:309:instart_session'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/http/connection_pool.rb:125:in session_for'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/http/net_http_handler.rb:55:inhandle'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:252:in block in make_sync_request'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:288:inretry_server_errors'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:248:in make_sync_request'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:510:inblock (2 levels) in client_request'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:390:in log_client_request'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:476:inblock in client_request'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:372:in return_or_raise'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/aws-sdk-1.37.0/lib/aws/core/client.rb:475:inclient_request'
(eval):3:in describe_instances'
/Users/mymac/dev/padrino_workspace/aem_dashboard/app/controllers/aem.rb:24:inblock (2 levels) in '
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:699:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:699:inblock in route'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:62:in []'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:62:inblock (3 levels) in process_destination_path'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:976:in route_eval'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:62:inblock (2 levels) in process_destination_path'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:62:in catch'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:62:inblock in process_destination_path'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:37:in instance_eval'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:37:inprocess_destination_path'
(eval):20:in block in call'
(eval):9:incatch'
(eval):9:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/http_router-0.11.1/lib/http_router.rb:288:inraw_call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/http_router-0.11.1/lib/http_router.rb:142:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:1101:inroute!'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:1086:in block in dispatch!'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:inblock in invoke'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in catch'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:ininvoke'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/application/routing.rb:1084:in dispatch!'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:inblock in call!'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in block in invoke'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:incatch'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1049:in invoke'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:889:incall!'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:877:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sass-3.3.3/lib/sass/plugin/rack.rb:54:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/xss_header.rb:18:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/json_csrf.rb:18:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/base.rb:50:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-protection-1.5.2/lib/rack/protection/frame_options.rb:31:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/head.rb:11:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/methodoverride.rb:21:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/reloader/rack.rb:22:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/logger.rb:398:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/show_exceptions.rb:21:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:225:incontext'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/session/abstract/id.rb:220:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:2004:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:in block in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1778:insynchronize'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/sinatra-1.4.4/lib/sinatra/base.rb:1469:in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/router.rb:82:inblock in call'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/router.rb:75:in each'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/router.rb:75:incall'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/connection.rb:86:in block in pre_process'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/connection.rb:84:incatch'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/connection.rb:84:in pre_process'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/connection.rb:53:inprocess'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/connection.rb:39:in receive_data'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:inrun_machine'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/eventmachine-1.0.3/lib/eventmachine.rb:187:in run'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/backends/base.rb:73:instart'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thin-1.6.2/lib/thin/server.rb:162:in start'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/handler/thin.rb:16:inrun'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/rack-1.5.2/lib/rack/server.rb:264:in start'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/server.rb:50:instart'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/server.rb:39:in start'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/server.rb:12:inrun!'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/cli/adapter.rb:7:in start'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/lib/padrino-core/cli/base.rb:32:instart'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.17.0/lib/thor/task.rb:27:in run'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.17.0/lib/thor/invocation.rb:120:ininvoke_task'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.17.0/lib/thor.rb:344:in dispatch'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/thor-0.17.0/lib/thor/base.rb:434:instart'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/gems/padrino-core-0.12.0/bin/padrino:9:in <top (required)>'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/bin/padrino:23:inload'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/bin/padrino:23:in <main>'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:ineval'
/Users/mymac/.rvm/gems/ruby-2.0.0-p247/bin/ruby_executable_hooks:15:in `'
这是我的 gem 文件:
ruby '2.0.0'
gem 'rake'
gem 'thin'
gem 'bcrypt-ruby', :require => 'bcrypt'
gem 'sass'
gem 'haml'
gem 'mongoid', '~>3.0.0'
gem 'mocha', :group => 'test', :require => false
gem 'shoulda', :group => 'test'
gem 'rack-test', :require => 'rack/test', :group => 'test'
gem 'padrino', '0.12.0'
gem "bootstrap-sass", "~> 3.1.1.0"
gem 'aws-sdk', '~> 1.37.0'
gem 'rest-client', '~> 1.6.7'
gem 'net-ping', '~> 1.7.2'
如果我在 irb、sinatra 和 rails 中尝试以下代码,它运行良好:
AWS.config(access_key_id: 'ACCESS_KEY',
secret_access_key: 'secret_access_key',
region: 'ap-southeast-2')
ec2 = AWS::EC2.new
response = ec2.client.describe_instances(:instance_ids => ['instance_id'])
@instance = response[:reservation_set].first[:instances_set].first
谁能帮帮我。谢谢。
我使用的是 ruby 2.0.0、padrino 0.12.0 和 OS X 10.8.2。问候强尼
最佳答案
您的区域配置可能有误。我遇到了同样的错误 when trying to access an S3 bucket .因为我的桶是美国标准的,又名“us-east-1”,这个配置最终起作用了:
AWS.config(access_key_id: 'xxx',
secret_access_key: 'xxx',
region: 'us-west-1',
s3: { region: 'us-east-1' })
关于amazon-web-services - SocketError at/getaddrinfo : nodename nor servname provided, 或未知 padrino,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22588089/
我正在使用 Vagrant 运行 Centos 虚拟机。机器似乎运行正常,但是当我尝试同步 Perforce 时,我可以看到以下错误: [vagrant@vagrant-c5-x86_64 ~]$ /
我无法通过 paramiko 连接到其他服务器: import paramiko import sys import os hostname = 'server1' port = 22 usernam
所以,在我得到这个错误之后,我一直在这里寻找答案,几乎每个人都有一个很难解决这个错误的方法,但是没有人解释为什么会发生这个错误,所以我不认为这个问题是完全重复。 我用 C 语言编写了一个 TCP 套接
我正在尝试用 C 编写套接字程序。当我这样做时,我的整个代码都可以正常工作 #define PORT "3333" 但不是 #define PORT getParameter("setting.ini
我的 laradock 项目遇到了麻烦:我已经下载并安装了 docker,并且我已经使用 laradock 成功完成了我的 laravel 项目的设置。我使用 php 7、laravel(5.5.14
我基本上为 FOG 设置了以下 right out of the FOG website : def fog_save_file_for(filename, file) # create a co
我正在尝试使用带有路径样式 url 的 s3cmd 从我的 S3 存储桶访问对象。这个用Java SDK之类的是没有问题的。 s3Client.setS3ClientOptions(S3ClientO
当我尝试使用 MAMP 连接到 mac 上的主机时出现此错误 php_network_getaddresses: getaddrinfo failed: nodename nor servname p
我被一个看似与 asyncio + aiohttp 相关的问题难住了,当发送大量并发 GET 请求时,超过 85% 的请求会引发 aiohttp.client_exceptions.ClientCon
我尝试执行 git pull --rebase 但我收到以下错误: ssh: Could not resolve hostname git: nodename nor servname provide
我在运行 Mac OS X 10.6 的计算机上部署了一个 Ruby on Rails 应用程序。出现问题的代码是由delayed_job运行的。只有在通过 delayed_job 运行时才会出现此问
有人可以帮忙吗?? 我在连接时收到此错误.. abort: error: nodename nor servname provided, or not known 请帮帮我。 实际上我想从存储库中获取
我正在遵循这个关于本地安装 Mesos 的简单指南 https://mesosphere.com/2014/07/07/installing-mesos-on-your-mac-with-homebr
我正在尝试在 Docker 上设置 Symfony4 项目,除了 Doctrine CLI 功能之外,一切正常。当我通过 CLI 运行命令时,它似乎无法连接到数据库。 phpMyAdmin 和项目本身
我正在尝试通过 Python 脚本通过 SSH 连接到服务器。目前我正在试用 paramiko。我在客户端和服务器之间设置了一个公钥,所以我不需要密码。我目前正在使用以下代码: ssh = param
我正在尝试通过本教程学习如何使用套接字: https://www.tutorialspoint.com/python/python_networking.htm 我已将网站上的代码复制到我的目录中,并
我是 Hadoop 新手。我使用这个 link 在我的 MAC 上安装了 Hadoop 一开始它对我来说就像一个魅力,但现在当我从 Eclipse 运行相同的 WordCount 问题时遇到了这个问题
我观察到,这是因为端口。端口是 C++ 字符串。当我硬编码端口号时说“4091”我没有看到这个问题。有什么建议吗? int sockfd; struct addrinfo hints, *servin
我间歇性地收到此错误,但当它发生时,我使用 Django 的 LiveServerTestCase 进行的自动集成测试突然停止并抛出以下错误: WSGIServerException: [Errno
我正在尝试编写一个 go http 服务器,但是当我尝试收听传入连接时遇到问题。 硬件设置:MacOS Sierra 10.12.4,docker 17.03 我有一个 yml 文件可以打开一个 .
我是一名优秀的程序员,十分优秀!