从源安装nginx-1.7.8时,Chef :: Exceptions :: ChecksumMismatch

前端之家收集整理的这篇文章主要介绍了从源安装nginx-1.7.8时,Chef :: Exceptions :: ChecksumMismatch前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

运行vagrant时出现以下错误 – 使用vagrant设置我的开发环境…

==> default: [2014-12-08T20:33:51+00:00] ERROR: remote_file[http://Nginx.org/download/Nginx-1.7.8.tar.gz] (Nginx::source line 58) had an error: Chef::Exceptions::ChecksumMismatch: Checksum on resource (0510af) does not match checksum on content (12f75e)

我的厨师JSON为Nginx提供以下内容

"Nginx": {
"version": "1.7.8","user": "deploy","init_style": "init","modules": [
  "http_stub_status_module","http_ssl_module","http_gzip_static_module"
],"passenger": {
  "version": "4.0.53","gem_binary": "/home/vagrant/.rbenv/shims/gem"
},"configure_flags": [
  "--add-module=/home/vagrant/.rbenv/versions/2.1.5/lib/ruby/gems/2.1.0/gems/passenger-3.0.18/ext/Nginx"
],"gzip_types": [
  "text/plain","text/html","text/css","text/xml","text/javascript","application/json","application/x-javascript","application/xml","application/xml+RSS"
]}

和Cheffile有以下食谱:

cookbook 'Nginx'

如何解决校验和不匹配问题?

nginx cookbook要求您在使用其他版本的Nginx时编辑校验和属性.导致您出错的remote_file资源是:

remote_file Nginx_url do
  source   Nginx_url
  checksum node['Nginx']['source']['checksum']
  path     src_filepath
  backup   false
end

您需要更新校验和值.特别是节点[‘Nginx’] [‘source’] [‘checksum’].

所以在你的JSON中,你会添加这一行:

"source": {"checksum": "insert checksum here" }

编辑:正如评论中指出的,校验和是SHA256.您可以生成文件的校验和,如下所示:

shasum -a 256 Nginx-1.7.8.tar.gz

猜你在找的Nginx相关文章