run rails applicaton after capistrano deployment

2019-07-25 03:55发布

问题:

Deploying rails app throw Capistrano first time: I deployed my rails app on another machine (server)

File structure for rails app ## this is my server

akshay@akshay:/var/www/model_demo$ ls
current  releases  repo  revisions.log  shared

cap -T ## showing a lots of rake task

like

cap deploy:migrate # Runs rake db:migrate if migrations are set

If I run this task it is not working saying

Stage not set, please call something such as `cap production deploy`, where production is a stage you have defined.

But when I run

cap production deploy  # It works

Among all the listed task only cap production deploy

1: what exactly going on under the hood?

2: How might i run rake task which is provided by cap?

Any help would be appreciated !!!

回答1:

Capistrano recepies are meant to run on local system. Run it locally.



回答2:

I catch my mistake. And as I followed Railscasts Capistrano screencasts, stackoverflow Capistrano Tags and deploying-rails-apps-to-a-vps-with-capistrano-v3.

As all cap tasks run locally.

cap production deploy:migrate # Worked for me

Thanks to @maxd !!!