gpt4 book ai didi

ruby-on-rails - 为什么 capistrano multiconfig 不工作?

转载 作者:太空宇宙 更新时间:2023-11-03 16:44:07 25 4
gpt4 key购买 nike

我的应用程序有一个有效的 capistrano 设置,但我安装了 multiconfig gem,以便我可以使用 capistrano 部署到两个不同的服务器。运行

cap primary:production deploy

完美运行,但是当我运行 rails s 时出现此错误:

rails s 

/home/sofia/.rvm/gems/ruby-2.2.2@big/gems/capistrano-multiconfig-3.0.9/lib/capistrano/multiconfig.rb:3:in `<top (required)>': uninitialized constant Capistrano::DSL (NameError)
from /home/sofia/.rvm/gems/ruby-2.2.2@big/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `require'
from /home/sofia/.rvm/gems/ruby-2.2.2@big/gems/bundler-1.12.5/lib/bundler/runtime.rb:100:in `rescue in block in require'
...

这是我的 config/ 文件夹中的目录:

deploy
deploy/secondary
deploy/secondary/production.rb.example
deploy/secondary/production.rb
deploy/staging.rb
deploy/primary
deploy/primary/production.rb.example
deploy/primary/production.rb

这是我的封面

# Load DSL and set up stages
# require 'capistrano/setup'# The README says to remove this line
# and leaving it on does not change anything anyway

require 'capistrano/multiconfig'


# Include default deployment tasks
require 'capistrano/deploy'

require 'capistrano/rvm'
require 'capistrano/bundler'
require 'capistrano/rails/assets'
require 'capistrano/rails/migrations'
require 'capistrano/passenger'
require "whenever/capistrano"


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

这是我的 Gemfile

source 'https://rubygems.org'

gem 'rest-client'

gem 'yui-compressor'
gem 'pg'
gem 'react-rails', '~> 1.5.0'

gem "paperclip", "~> 4.3"

gem 'aws-sdk-rails'

gem 'whenever', :require => false
gem 'tod'

...

group :development, :test do
gem 'byebug'
end

group :development do
gem 'capistrano'
gem 'capistrano-bundler'
gem 'capistrano-passenger', '>= 0.1.1'
gem 'capistrano-rails'
gem 'capistrano-rvm'
# Allows us to specify a separate configuration for each application/service
gem "capistrano-multiconfig"


# Access an IRB console on exception pages or by using <%= console %> in views
gem 'railroady'
gem 'web-console', '~> 2.0'
gem 'letter_opener'
# Spring speeds up development by keeping your application running in the background. Read more: https://github.com/rails/spring
gem 'spring'
end

最佳答案

这是 capistrano-multiconfig v3.0.9 的错误,现已在 v3.0.10 中修复

关于ruby-on-rails - 为什么 capistrano multiconfig 不工作?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38085591/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com