railsware/capistrano-multiconfig — Issue #2: undefined method `server' for main:Object (NoMethodError)
Author: kortina
Created: 2011-12-26 18:25:17+00:00
State: open

I created a test project to try getting this working, am having trouble splitting up my configuration files. In config/deploy.rb, I have

set :config_root, 'config/deploy'
require 'capistrano/multiconfig'

To test, I did:

mkdir -p config/deploy/app/blog/production.rb
mkdir -p config/deploy/app/blog/staging.rb

And put

server 'staging.kortina.net', :app, :primary => true

server 'production.kortina.net', :app, :primary => true

In each of these files. However, I get an error when I do

cap app:blog:production shell
* executing `app:blog:production'
/tmp/capmst/config/deploy/app/blog/production.rb:1: undefined method `server' for main:Object (NoMethodError)

It appears the context is incorrect when the staging and production config files actually get loaded.