在capistrano部署之后运行rails应用程序

时间:2015-03-02 08:56:55

标签: ruby-on-rails ruby capistrano capistrano3

第一次部署rails app引发Capistrano :我在另一台机器(服务器)上部署了我的rails应用程序

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

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

如果我执行此任务,则说明

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

但是当我跑步时

cap production deploy  # It works

仅列出的所有任务cap production deploy

1:引擎盖下到底发生了什么?

2:我如何运行由cap提供的rake任务?

任何帮助将不胜感激!!!

2 个答案:

答案 0 :(得分:1)

Capistrano recepies意味着在本地系统上运行。 在本地运行。

答案 1 :(得分:0)

我抓住了我的错误。我跟着Railscasts Capistrano screencastsstackoverflow Capistrano Tagsdeploying-rails-apps-to-a-vps-with-capistrano-v3

<强> As all cap tasks run locally

cap production deploy:migrate # Worked for me

感谢@maxd !!!