capistrano找不到以前的版本

时间:2012-10-23 11:35:32

标签: ruby-on-rails ruby-on-rails-3 capistrano

我刚刚使用我的capistrano部署了一个旧项目,它部署好了,但我需要回滚。当我尝试使用命令'cap deploy:rollback'回滚时,我收到此错误:

[Deprecation Warning] Naming tasks with before_ and after_ is deprecated, please see the new before() and after() methods. (Offending task name was before_update_code)
[Deprecation Warning] Naming tasks with before_ and after_ is deprecated, please see the new before() and after() methods. (Offending task name was after_update_code)
  * executing `deploy:rollback'
  * executing `deploy:rollback:revision'
  * executing "ls -x /home/<my user>/<my project>/releases"
    servers: ["www.my_webserver.com"]
    [www.my_webserver.com] executing command
    command finished
  * executing "rm /home/<my user>/<my project>/current; ln -s /home/<my user>/<my project>/releases/20121023110110 /home/<my user>/<my project>/current"
    servers: ["www.my_webserver.com"]
    [www.my_webserver.com] executing command
    command finished
    triggering after callbacks for `deploy:rollback:revision'
  * executing `bundler:install'
  * executing "cd /home/<my user>/<my project>/releases/20121023112609 && bundle install"
    servers: ["www.my_webserver.com"]
    [www.my_webserver.com] executing command
 ** [out :: www.my_webserver.com] bash: line 0: cd: /home/<my user>/<my project>/releases/20121023112609: No such file or directory
    command finished
failed: "rvm_path=$HOME/.rvm/ $HOME/.rvm/bin/rvm-shell '1.9.2' -c 'cd /home/<my user>/<my project>/releases/20121023112609 && bundle install'" on www.my_webserver.com

如果我启动'cap shell'并快速查看,我找不到它正在寻找的20121023112609目录。

cap> ls -x /home/<my user>/<my project>/releases
 ** [out :: www.my_webserver.com] 20120418231223    20120419004108  20120421030033  20120422072111  20120422101603
 ** [out :: www.my_webserver.com] 20120526035027    20120526113216  20120528100439  20120528102509  20120528135335
 ** [out :: www.my_webserver.com] 20120604090722    20120724142113  20121008114048  20121008114947  20121008125600
 ** [out :: www.my_webserver.com] 20121015121531    20121015122225  20121023110110  20121023111648

我可以看到我的最新部署在那里,但它被称为'20121023111648',而我想要恢复的先前部署称为'20121023110110'。

好像有时差或什么?

1 个答案:

答案 0 :(得分:0)

在这里查看你的答案railsless-deploy

cap deploy:rollback

运行上面的命令进行回滚。