2015-06-22 78 views
0

我正试图通过capistrano学习部署。当我运行部署脚本时,除迁移之外,一切工作都正常。无法加载此文件 - 打包程序/安装程序 - Capistrano

我收到以下错误。

INFO [175f4b0b] Running /usr/bin/env rake db:migrate as 

[email protected] 
DEBUG [175f4b0b] Command: cd /home/prajeesh/Desktop/projects/capistrano_staging/current && (RAILS_ENV=development /usr/bin/env rake db:migrate) 
DEBUG [175f4b0b] rake aborted! 
DEBUG [175f4b0b]  

cannot load such file -- bundler/setup 

Capfile

# Load DSL and set up stages 
require 'capistrano/setup' 

# Include default deployment tasks 
require 'capistrano/deploy' 
#require 'capistrano/rails/assets' 
require 'capistrano/rails/migrations' 

# Load custom tasks from `lib/capistrano/tasks` if you have any defined 
Dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r } 

部署文件

# config valid only for current version of Capistrano 
lock '3.4.0' 

set :application, 'capistrano_study' 
set :repo_url, 'https://github.com/xxxxxxxx/capistrano_study.git' 

# config valid only for current version of Capistrano 
set :stages, ["development","staging", "production"] 
set :default_stage, "development" 
set :user, "prajeesh" 
after "deploy:updated", "deploy:migrate" 

set :keep_releases, 5 

namespace :deploy do 
    after :restart, :clear_cache do 
    on roles(:web), in: :groups, limit: 3, wait: 10 do 
     # Here we can do anything such as: 
     # within release_path do 
     # execute :rake, 'cache:clear' 
     # end 
    end 
    end 
end 

如果我运行命令RAILS_ENV =发展的/ usr/bin中/ env的耙分贝:直接从项目路径迁移,迁移正在运行,但通过capistrano它不起作用。

任何帮助,将不胜感激。

+0

请告诉你Capfile以及config/deploy.rb如果可能 – CodeGroover

+0

添加所需的详细信息 – prajeesh

+0

我认为你缺少https://github.com/capistrano/bundler/ – CodeGroover

回答

0

我不得不这样做是安装宝石'capistrano-rvm'和requi重新上盖文件

1

这里是你的答案:

安装以下宝石:

gem 'capistrano-rails', '~> 1.1' 

,并要求捆绑任务

# Capfile 
require 'capistrano/bundler' # Rails needs Bundler, right? 
require 'capistrano/rails/assets' 
require 'capistrano/rails/migrations' 

来源: https://github.com/capistrano/rails/

相关问题