且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

EC2 - 不能部署为"汇出"用户

更新时间:2023-09-20 23:52:46

 须藤CHOWN为-R使用者> <文件夹路​​径>
 

做的伎俩。用户不是文件夹的所有者,因此帽检查被扔错误。

I am using Capistrano for deploying a Rails app to Amazon EC2. In the deploy files, I have following credentials for connecting to Amazon EC2:

set :user, "bitnami"
#set :user, "root"
server "ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com", :app, :web, :db, :primary => true
ssh_options[:keys] = ["/Users/ada/my_amazon_ec2.pem"]

When I run cap deploy:setup and cap deploy:check, I get following:

The following dependencies failed. Please check them and try again:
--> You do not have permissions to write to `/www/myapp'. (ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com)
--> You do not have permissions to write to `/www/myapp/releases'. (ec2-XX-XXX-XXX-XX.compute-1.amazonaws.com)

How's that possible? I am able to connect via SSH to EC2 as the user bitnami, but when I try it as the user root, I get the message that I should use the bitnami user for login and the connection is closed.

If I try to change in the deploy files change the bitnami user for root, the whole deployment process is ok, but then when I log in through SSH (as the bitnami user) to EC2, I don't see any files that should be deployed, the final directory is just empty.

What is wrong in this case?

Thank you so much

sudo chown -R <user> <folder path>

did the trick. The user was not the owner of the folder and hence cap check was throwing error.