ruby-on-rails - capistrano 错误 : . ..../current: 没有

我正在尝试使用 capistrano 进行部署,但是当我执行 cap deploy:update 时,它​​没有创建/current 文件夹,这是错误,有什么想法吗?

executing "cd /home/adamtodd/apps/homebase/current && bundle exec rake RAILS_ENV=production RAILS_GROUPS=assets assets:precompile --trace"
servers: ["xx.xxx.xx.xxx"]
[xx.xxx.xx.xxx] executing command
 ** [out :: xx.xxx.xx.xxx] bash: line 0: cd: /home/adamtodd/apps/homebase/current: No such file or directory

最佳答案

当我在第一次部署时使用 Ben Curtis 解决方案进行 Assets 预编译( assets:precompile task redifinition )时遇到了同样的问题(deploy:cold 没有帮助我)

简单的解决方法 here

namespace :deploy do
  namespace :assets do
    task :precompile, :roles => :web, :except => { :no_release => true } do
      begin
        from = source.next_revision(current_revision) # <-- Fail here at first-time deploy because of current/REVISION absence
      rescue
        err_no = true
      end
      if err_no || capture("cd #{latest_release} && #{source.local.log(from)} vendor/assets/ app/assets/ | wc -l").to_i > 0
        run %Q{cd #{latest_release} && #{rake} RAILS_ENV=#{rails_env} #{asset_env} assets:precompile}
      else
        logger.info "Skipping asset pre-compilation because there were no asset changes"
      end
   end
  end
end

关于ruby-on-rails - capistrano 错误 : . ..../current: 没有这样的文件或目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10907242/

相关文章:

django - 从 Django 中的一系列 id 中检索匹配对象的列表

wordpress - 在单个页面上显示 WordPress 博客的所有评论?

jruby - bundler 无法识别平台?找不到 gem

python - 如何使用 python grep 大文件中两个模式之间的行

ruby-on-rails - 事件管理员 : pass instance variable for

c# - C#中如何从子构造函数调用父构造函数

php - 使用 PHP DOM 方法读取 iTunes XML 文件

django - 重定向到管理员登录

php - 用于匹配标点符号和字母数字字符的正则表达式

php - 将时间戳转换为 .ics iCal 兼容的日期格式