我使用 Ansible 在 EC2 上运行 AmazonLinux2。但是,当执行取消归档命令时,会显示以下错误。
"Failed to find handler for \"/tmp/hoge.db.gz\".
Make sure the required command to extract the file is installed.
Command \"/usr/bin/unzip\" could not handle archive. Command \"/usr/bin/gtar\" could not handle archive."
Run Code Online (Sandbox Code Playgroud)
PlayBook的内容如下。
- name: Unarchive hoge
become: yes
unarchive:
src: /tmp/hoge.db.gz
dest: /root/fuga/
remote_src: yes
Run Code Online (Sandbox Code Playgroud)
以下是我检查过的信息,以确定错误原因。
"Failed to find handler for \"/tmp/hoge.db.gz\".
Make sure the required command to extract the file is installed.
Command \"/usr/bin/unzip\" could not handle archive. Command \"/usr/bin/gtar\" could not handle archive." …Run Code Online (Sandbox Code Playgroud) 执行rspec时,长时间没有响应,然后出现Net::ReadTimeout:,测试失败。
目前,我们正在Ubuntu docker上构建rails 5.1.7的开发环境。在此基础上,为了进行包括js在内的视图测试,使用系统测试的selenium_chrome_headless搭建了测试环境。
我删除了 application.html.erb 的源代码来确定错误发生的位置。结果我们发现<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>会超时。下面是一些代码。
application.html.erb
<!DOCTYPE html>
<html>
<head>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
规格/视图/hoges/index_spec.rb
<!DOCTYPE html>
<html>
<head>
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track': 'reload' %>
</head>
<body>
</body>
</html>
Run Code Online (Sandbox Code Playgroud)
rails_helper.rb 的一部分
require 'rails_helper'
RSpec.feature 'MetaFramesIndex', type: :system, js: true do
scenario 'sample' do
visit hoges_index_path
end
end
Run Code Online (Sandbox Code Playgroud)
错误日志
Capybara.register_driver :selenium_chrome_headless do |app|
browser_options = ::Selenium::WebDriver::Chrome::Options.new
browser_options.args << '--headless'
browser_options.args …Run Code Online (Sandbox Code Playgroud)