【问题标题】:Capistrano Deployment failure : /etc/init.d/unicorn: line 42: rvm-shell command not foundCapistrano 部署失败:/etc/init.d/unicorn:第 42 行:找不到 rvm-shell 命令
【发布时间】:2014-04-24 05:48:51
【问题描述】:

我在 Rails 中使用 Unicorn 和 capistrano 部署到服务器......

但在部署的最后一步。 Capistrano 存在此错误:

 INFO [47010f4f] Running /usr/bin/env service unicorn_app restart on xyzdomain.com
DEBUG [47010f4f] Command: service unicorn_app restart
DEBUG [47010f4f]    Couldn't reload, starting 'cd /var/www/app/current; rvm-shell 'default' -c 'bundle exec unicorn -D -c /var/www/app/shared/config/unicorn.rb -E staging'' instead
DEBUG [47010f4f]    
DEBUG [47010f4f]    /etc/init.d/unicorn_app: line 42: rvm-shell: command not found
DEBUG [47010f4f]    
cap aborted!

当我从服务器上的终端运行 rvm-shell 命令时,它运行时没有错误。

注意:rvm-shell 安装在 ~/.rvm/bin 中。所以这与这里提到的错误不同:https://github.com/capistrano/capistrano/issues/43

为什么会这样?

【问题讨论】:

    标签: ruby-on-rails ruby-on-rails-4 capistrano unicorn rvm-capistrano


    【解决方案1】:

    解决了问题:

    这实际上是服务器上的一些权限问题

    当我执行命令时,该命令直接在服务器上失败,它产生了一些目录权限错误。我通过手动创建这些目录来解决它们。

    cd /var/www/app/shared
    mkdir pids
    mkdir logs
    

    奇怪的是 Capistrano 在部署失败时没有显示具体的失败错误,这导致了很多混乱并浪费了调试时间。

    希望我的回答能帮助其他人,如果他们遇到类似的错误并节省大量时间。 :)

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-09-09
      • 2012-12-20
      • 1970-01-01
      相关资源
      最近更新 更多