简体   繁体   English

无法加载此类文件—捆绑器/设置-Capistrano

[英]cannot load such file — bundler/setup - Capistrano

I am trying to learn deployment via capistrano. 我正在尝试通过capistrano学习部署。 When i run the deploy script everything is working fine except the migration. 当我运行部署脚本时,除迁移外,其他所有东西都工作正常。

I am getting the following error. 我收到以下错误。

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

prajeesh@xx.x.x.xxx
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 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 }

Deploy file 部署文件

# 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

If i run the command RAILS_ENV=development /usr/bin/env rake db:migrate directly from the project path, the migration is running but through capistrano it is not working. 如果我直接从项目路径运行命令RAILS_ENV = development / usr / bin / env rake db:migrate,则迁移正在运行,但通过capistrano无法正常工作。

Any help would be appreciated. 任何帮助,将不胜感激。

Here is your answer: 这是您的答案:

Install the following gem: 安装以下gem:

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

and require the bundler tasks 并需要捆绑器任务

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

Source: https://github.com/capistrano/rails/ 资料来源: https : //github.com/capistrano/rails/

我要做的就是安装gem'capistrano-rvm'并在文件中要求它

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 LoadError:无法加载此类文件—捆绑程序/设置capistrano - LoadError: cannot load such file — bundler/setup capistrano 没有要加载的此类文件-Capistrano部署时的捆绑程序/设置 - no such file to load — bundler/setup when capistrano deploy `require':无法加载此类文件-捆绑程序/安装程序(LoadError) - `require': cannot load such file — bundler/setup (LoadError) 加载错误:无法加载此类文件 -- 捆绑程序/设置 - LoadError: cannot load such file -- bundler/setup rbenv passenger无法加载此类文件-捆绑器/设置 - rbenv passenger cannot load such file — bundler/setup 没有要加载的文件 - bundler/setup - no such file to load — bundler/setup 使用NGINX的Passsenger无法加载此类文件-捆绑程序/安装程序(LoadError) - Passsenger with NGINX cannot load such file — bundler/setup (LoadError) 使用nginx的乘客:无法加载此类文件 - bundler / setup(LoadError) - Passenger with nginx: cannot load such file — bundler/setup (LoadError) “ db:migrate rake”抛出错误“无法加载此类文件-捆绑程序/安装程序” - “db:migrate rake” throwing eror “cannot load such file — bundler/setup” docker apache passenger:错误无法加载此类文件捆绑程序/安装程序(LoadError) - docker apache passenger: error cannot load such file bundler/setup (LoadError)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM