I had a working capistrano setup for my app but I installed the multiconfig gem so that I could deploy to two different servers using capistrano. Running
cap primary:production deploy
works perfectly, but when I run rails s
I get this error:
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'
...
This is the directories inside my config/
folder:
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
This is my 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 }
This is my 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