在运行vagrant up --provision以设置我的开发环境与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)
Run Code Online (Sandbox Code Playgroud)
我的厨师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"
]}
Run Code Online (Sandbox Code Playgroud)
和Cheffile有以下食谱:
cookbook 'nginx'
Run Code Online (Sandbox Code Playgroud)
如何解决校验和不匹配问题?
每当我运行bundle install我的VPS(CentOS Linux版本7.0.1406(Core))时,我在安装pg gem时出错.
No pg_config... trying anyway. If building fails, please try again with
--with-pg-config=/path/to/pg_config
checking for libpq-fe.h... no
Can't find the 'libpq-fe.h header
*** extconf.rb failed ***
Could not create Makefile due to some reason, probably lack of necessary
libraries and/or headers. Check the mkmf.log file for more details. You may
need configuration options.
Run Code Online (Sandbox Code Playgroud)
我可以用:安装pg standalone,gem install pg -- --with-pg-config=/usr/pgsql-9.4/bin/pg_config问题解决了.
所以我添加了一个capistrano任务来为部署创建一个./bundle/config,其中build.pg键设置为我的VPS上的pg_config路径.在Capistrano config/deploy.rb这被调用before bundler:install.
desc "Create bundle config"
task :prepare_bundle_config do
on …Run Code Online (Sandbox Code Playgroud) 我想从TimeSpan对象创建一个字符串,其格式为:"hhhh:mm:ss.ff".
当我使用以下内容时,我得到一个FormatException ...
private const string MAX_TIME_ALLOWED_FORMAT = @"hhhh\:mm\:ss.ff";
String myDurationSring = TimeSpan.FromSeconds(myDurationInSeconds).ToString(MAX_TIME_ALLOWED_FORMAT) : string.Empty;
Run Code Online (Sandbox Code Playgroud)
我的格式字符串是否需要一些工作或者有更好的方法吗?
centos ×2
bundler ×1
c# ×1
capistrano ×1
centos7 ×1
chef-infra ×1
formatting ×1
nginx ×1
pg ×1
timespan ×1
vagrant ×1