Capistrano部署的问题:迁移 [英] Problems with Capistrano's deploy:migrate

查看:59
本文介绍了Capistrano部署的问题:迁移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

尝试部署时遇到以下错误:使用Capistrano迁移:

I'm getting the following error while trying to deploy:migrate with Capistrano:

[err :: 127.0.0.1 ] /home/synapse/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems.rb:388:in `bin_path': can't find gem rake ([">= 0"]) with executable rake (Gem::GemNotFoundException)

在获得耙之前未找到错误,但在我将 set:rake添加到deploy.rb后消失了。 Ruby是通过RVM安装的,并且rake gem当然是安装的。

Before that I was getting rake not found' error but it was gone after I added "set :rake" to deploy.rb. Ruby is installed via RVM and rake gem is of course installed.

推荐答案

对于capistrano,您需要添加rvm扩展名

for capistrano you need to add extensions for rvm

set :rvm_ruby, "ruby-1.9.2-p180"
set :rvm_gem_home, "#{fetch(:base_dir)}/.rvm/gems/#{fetch(:rvm_ruby)}"
set :rvm_ruby_path, "#{fetch(:base_dir)}/.rvm/rubies/#{fetch(:rvm_ruby)}"
set :default_environment, {
  'RUBY_VERSION' => fetch(:rvm_ruby),
  'GEM_HOME' => "#{fetch(:rvm_gem_home)}:#{fetch(:rvm_gem_home)}@global",
  'BUNDLE_PATH' => fetch(:rvm_gem_home),
  'PATH' => "#{fetch(:rvm_gem_home)}/bin:#{fetch(:rvm_gem_home)}@global/bin:#{fetch(:rvm_ruby_path)}/bin:/home/rails/.rvm/bin:$PATH;",
}

这篇关于Capistrano部署的问题:迁移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆