尝试 运行 独角兽时写入错误:pid=/var/www/twimpush/pids/unicorn.pid 的目录不可写(ArgumentError)

Write error when trying to run unicorn: directory for pid=/var/www/twimpush/pids/unicorn.pid not writable (ArgumentError)

我已按照 DigitalOcean 指南 here and here 中的步骤使用 nginx 和 Unicorn 设置 Sinatra 服务器。我在倒数第二步:

start the Unicorn and run it as a daemon using the configuration file: Make sure that you are inside the application directory i.e. /my_app

unicorn -c unicorn.rb -D

运行那个命令,我得到错误:

directory for pid=/var/www/twimpush/pids/unicorn.pid not writable (ArgumentError)

我以 root 和名为 deployer 的用户身份尝试过此操作,我授予了写权限。

当我克隆我的 git 存储库时,它没有在我的存储库中包含空的 pids 文件夹。除了第一个指南中提到的其他必需文件夹之外,我还使用 mkdir pids 添加了它,并且它起作用了。