title: Undefined method `instance' for Capistrano::Configuration:Class
body: <p>I am trying to get Capistrano up and running for the first time in a rails app. I have a linux server running Ubuntu 12.04, nginx, unicorn and rails, however, I seem to be running into a few issues. I am also using Capistrano 3.0.0, rails 3.2.14, bundler 1.4.0 &amp; ruby 1.9.3p448 using RVM. </p>
  
  <p>I only have a production stage set up and at this point in time and I'm only concerned with Capistrano communicating with my server and pushing my code from github ( No migrations and bundling etc just yet).</p>
  
  <p>When I try the command <code>cap production deploy:check</code> or  <code>cap production deploy:setup</code> ( which seems to be deprecated?) with the setup below, I get the following error msg:</p>
  
  <p>I'm not really sure where to start on this error, and google doesn't suggest much. I have tried adding the <code>rvm-capistrano</code> gem but to no avail. How can I amend my code to address this error?</p>
  
  <pre><code>    cap aborted!
  undefined method `instance' for Capistrano::Configuration:Class
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/bundler-1.4.0.rc.1/lib/bundler/capistrano.rb:11:in `&lt;top (required)&gt;'
  config/deploy.rb:1:in `&lt;top (required)&gt;'
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-3.0.0/lib/capistrano/setup.rb:12:in `load'
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-3.0.0/lib/capistrano/setup.rb:12:in `block (2 levels) in &lt;top (required)&gt;'
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-3.0.0/lib/capistrano/application.rb:12:in `run'
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/gems/capistrano-3.0.0/bin/cap:3:in `&lt;top (required)&gt;'
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/bin/cap:23:in `load'
  /Users/andrew/.rvm/gems/ruby-1.9.3-p448/bin/cap:23:in `&lt;main&gt;'
  Tasks: TOP =&gt; production
  (See full trace by running task with --trace)
  </code></pre>
  
  <p>deploy.rb</p>
  
  <pre><code>require "bundler/capistrano"
  
  set :stages, %w(staging production)
  set :default_stage, "production"
  
  set :application, "my_app"
  set :user, "andrew"
  set :scm, "git"
  set :repository, "https://github.com/my_repo/#{application}"
  set :branch, "master"
  
  set :deploy_to, "/home/rails/#{application}"
  set :deploy_via, :remote_cache
  set :use_sudo, false
  
  default_run_options[:pty] = true
  ssh_options[:forward_agent] = true
  
  after "deploy", "deploy:cleanup" # keep only the last 5 releases
  
  namespace :deploy do
    task :restart, roles: :app do
        run "touch #{current_path}tmp/restart.txt"
      end
    end
    after :finishing, 'deploy:cleanup'
  </code></pre>
  
  <p>deploy/production.rb</p>
  
  <pre><code>#Real IP ommitted 
  server "10.2.32.68", :web, :app, :db, primary: true
  </code></pre>
  
  <p>Capfile</p>
  
  <pre><code># Load DSL and Setup Up Stages
  require 'capistrano/setup'
  
  # Includes default deployment tasks
  require 'capistrano/deploy'
  
  # require 'capistrano/rvm'
  # require 'capistrano/rbenv'
  # require 'capistrano/chruby'
  # require 'capistrano/bundler'
  # require 'capistrano/rails/assets'
  # require 'capistrano/rails/migrations'
  
  # Loads custom tasks from `lib/capistrano/tasks' if you have any defined.
  Dir.glob('lib/capistrano/tasks/*.cap').each { |r| import r }
  </code></pre>
  
  <p><strong>EDIT</strong> After looking at the offending line in capistrano.rb within bundler it mentions to add require 'bundler/deployment' to deploy.rb, which has seemed to get rid of the capistrano instance error.</p>
  
  <p><strong>NOTE</strong> Downgraded to capistrano 2.15.5 which got rid of the errors.</p>