Capistrano迁移部署 [英] Capistrano Migrations Deploy
问题描述
我对Ruby on Rails和Capistrano部署有疑问。我要做的第一件事是使用以下命令部署我的Rails应用程序:
I have a question about Ruby on Rails and Capistrano deploys. The first thing I do is deploy my Rails App using:
cap deploy:update
迁移后,我尝试运行Capistrano命令:
When I have migration, I try to run the Capistrano command:
cap deploy:migrations
我收到错误:
Could not find rake-0.9.2 in any of the sources
$中都找不到rake-0.9.2 b
$ b
我必须通过SSH进入服务器的当前文件夹并手动运行
I have to SSH into the current folder of the server and manually run
rake RAILS_ENV=production db:migrate
显然,使用迁移来运行每个部署都非常痛苦。
Which is obviously a huge pain to run every deploy with a migration.
我在做什么错?谢谢您的帮助。
What am I doing wrong? Thanks for the help.
推荐答案
您可能需要取消注释并调整 config /中的以下行deploy.rb
:
You might need to uncomment and adjust the following lines in your config/deploy.rb
:
# default_environment['PATH']='<your paths>:/usr/local/bin:/usr/bin:/bin'
# default_environment['GEM_PATH']='<your paths>:/usr/lib/ruby/gems/1.8'
另外,如果您使用的是RVM,则可能需要添加几行:
Additionally, if you are using RVM, you might need to add a few lines:
# adjust if you are using RVM, remove if you are not
$:.unshift(File.expand_path('./lib', ENV['rvm_path']))
require "rvm/capistrano"
set :rvm_ruby_string, '1.9.2'
set :rvm_type, :user
这篇关于Capistrano迁移部署的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!