Ruby on Rails每当+ capistrano v3集成时

 aaaaaaaaaaa530_552 发布于 2023-02-08 14:37

在我的项目即时使用+ capistrano,所以这是我的Capfile:

require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'whenever/capistrano'

Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }

这是我的deployr.rb档案:

set :application, 'privet-mccafe'
set :repo_url, 'git@codebasehq.com:digitalizm/mccafe-vk-privet-app/application.git'
set :scm, :git
set :branch, 'master'
set :keep_releases, 5
set :ssh_options, { forward_agent: true }

set :bundle_roles, :all

set :linked_files, %w{config/database.yml config/initializers/secret_token.rb}
set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}

namespace :deploy do
  desc 'Restart application'
  task :restart do
    on roles(:app), in: :sequence, wait: 5 do
      execute :mkdir, "-p #{release_path.join('tmp')}"
      execute :touch, release_path.join('tmp/restart.txt')
    end
  end
end

这是我的schedule.rb档案:

every 4.hours do
  rake "notifications:deliver"
end

无论如何,执行cap staging deploy,imting错误:

cap aborted!
undefined method `instance' for Capistrano::Configuration:Class
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/gems/whenever-0.8.4/lib/whenever/capistrano/recipes.rb:3:in `'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/gems/whenever-0.8.4/lib/whenever/capistrano.rb:1:in `require'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/gems/whenever-0.8.4/lib/whenever/capistrano.rb:1:in `'
/Users/xamenrax/code/application/Capfile:7:in `require'
/Users/xamenrax/code/application/Capfile:7:in `'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/lib/capistrano/application.rb:22:in `load_rakefile'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/lib/capistrano/application.rb:12:in `run'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/gems/capistrano-3.0.1/bin/cap:3:in `'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/bin/cap:23:in `load'
/Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/bin/cap:23:in `
' /Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `eval' /Users/xamenrax/.rvm/gems/ruby-2.0.0-p353/bin/ruby_executable_hooks:15:in `
' (See full trace by running task with --trace)

小智.. 11

每当〜> 0.9.0解决这个问题

每当<0.9与capistrano v3不兼容

1 个回答
  • 每当〜> 0.9.0解决这个问题

    每当<0.9与capistrano v3不兼容

    2023-02-08 14:38 回答
撰写答案
今天,你开发时遇到什么问题呢?
立即提问
热门标签
PHP1.CN | 中国最专业的PHP中文社区 | PNG素材下载 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有