为什么 capistrano multiconfig 不工作?
Why is capistrano multiconfig not working?
我的应用程序有一个可用的 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
这是我的 capfile
# 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 中修复
我的应用程序有一个可用的 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
这是我的 capfile
# 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 中修复