Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/mercurial/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ruby on rails Capistrano/Mercurial/tar“;“未来的时间戳”;消息_Ruby On Rails_Mercurial_Capistrano_Tar - Fatal编程技术网

Ruby on rails Capistrano/Mercurial/tar“;“未来的时间戳”;消息

Ruby on rails Capistrano/Mercurial/tar“;“未来的时间戳”;消息,ruby-on-rails,mercurial,capistrano,tar,Ruby On Rails,Mercurial,Capistrano,Tar,我在使用capistrano部署rails应用程序时遇到间歇性问题。将.gz上载到服务器后,日志显示来自tar的错误,该错误表示时间戳在将来(请参阅下面的输出)。对于应用程序中的每个文件,此消息都会重复 我将服务器时间与.tar.gz文件的数字名称进行了比较,结果确实提前了几分钟。但是这与文件上的实际时间戳有什么关系呢?我如何才能正确部署我的更改 ** sftp upload /var/folders/lo/loIUAyGAHFWqSREiNHhm-E+++TI/-Tmp-/2011060314

我在使用capistrano部署rails应用程序时遇到间歇性问题。将.gz上载到服务器后,日志显示来自tar的错误,该错误表示时间戳在将来(请参阅下面的输出)。对于应用程序中的每个文件,此消息都会重复

我将服务器时间与.tar.gz文件的数字名称进行了比较,结果确实提前了几分钟。但是这与文件上的实际时间戳有什么关系呢?我如何才能正确部署我的更改

** sftp upload /var/folders/lo/loIUAyGAHFWqSREiNHhm-E+++TI/-Tmp-/20110603143429.tar.gz -> /tmp/20110603143429.tar.gz
   [123.45.67.890] /tmp/20110603143429.tar.gz
   [123.45.67.890] done
 * sftp upload complete
 * executing "cd /home/blah/releases && tar xzf /tmp/20110603143429.tar.gz && rm /tmp/20110603143429.tar.gz"
   servers: ["123.45.67.890"]
   [123.45.67.890] executing command
** [out :: 123.45.67.890] tar: 20110603143429/.autotest: time stamp 2011-06-03 14:34:33 is 368.72042712 s in the future
** [out :: 123.45.67.890] tar: 20110603143429/.bundle: time stamp 2011-06-03 14:34:33 is 368.719540808 s in the future
** [out :: 123.45.67.890] tar: 20110603143429/.hgignore: time stamp 2011-06-03 14:34:33 is 368.719465444 s in the future
** [out :: 123.45.67.890] tar: 20110603143429/app: time stamp 2011-06-03 14:34:34 is 369.719382175 s in the future

 ** [out :: 123.45.67.890] tar: 20110603143429: time stamp 2011-06-03 14:34:49 is 383.369448435 s in the future
    command finished in 1616ms
  * executing `deploy:finalize_update'
  * executing "chmod -R g+w /home/blah/releases/20110603143429"
    servers: ["123.45.67.890"]
    [123.45.67.890] executing command
    command finished in 193ms
  * executing "rm -rf /home/blah/releases/20110603143429/log /home/blah/releases/20110603143429/public/system /home/blah/releases/20110603143429/tmp/pids &&\\\n      mkdir -p /home/blah/releases/20110603143429/public &&\\\n      mkdir -p /home/blah/releases/20110603143429/tmp &&\\\n      ln -s /home/blah/shared/log /home/blah/releases/20110603143429/log &&\\\n      ln -s /home/blah/shared/system /home/blah/releases/20110603143429/public/system &&\\\n      ln -s /home/blah/shared/pids /home/blah/releases/20110603143429/tmp/pids"
    servers: ["123.45.67.890"]
    [123.45.67.890] executing command
    command finished in 257ms
  * executing "find /home/blah/releases/20110603143429/public/images /home/blah/releases/20110603143429/public/stylesheets /home/blah/releases/20110603143429/public/javascripts -exec touch -t 201106031435.03 {} ';'; true"
    servers: ["123.45.67.890"]
    [123.45.67.890] executing command
    command finished in 1911ms
    triggering after callbacks for `deploy:update_code'
  * executing `bundle:install'
  * executing "ls -x /home/blah/releases"
    servers: ["123.45.67.890"]
    [123.45.67.890] executing command
    command finished in 140ms
  * executing "bundle install --gemfile /home/blah/releases/20110603143429/Gemfile --path /home/blah/shared/bundle --deployment --quiet --without development test"
    servers: ["123.45.67.890"]
    [123.45.67.890] executing command
 ** [out :: 123.45.67.890] sh: bundle: not found
    command finished in 158ms
*** [deploy:update_code] rolling back
  * executing "rm -rf /home/blah/releases/20110603143429; true"
    servers: ["123.45.67.890"]
    [123.45.67.890] executing command
    command finished in 261ms
failed: "sh -c 'bundle install --gemfile /home/blah/releases/20110603143429/Gemfile --path /home/blah/shared/bundle --deployment --quiet --without development test'" on 123.45.67.890

听起来你的时钟有点歪。过程中涉及的所有计算机--提交、发送、同步接收/部署?

我部署到的暂存/生产服务器与我的本地计算机位于不同的时区,但一直都是这样。Capistrano能够适应时区差异,不是吗?我确信它考虑了时区,但你仍然可以有时钟偏差。如果一个认为是东部8点01分,另一个认为是中部7点02分,你就有时钟偏移。这是我的问题。我的钟快了。它显示了未来10分钟的日期。在本地计算机上运行
date
,然后通过SSH连接到服务器并在那里运行
date
。如果比较输出并注意到较大的偏移,则可以将时钟与例如NTP同步:
$sudo ntpdate-s time.nist.gov