title: Rails 4 + Capistrano 3 - Deploy to Production Server from Local Repo
body: <p>I'm using Windows 10 and Cygwin, and I am setting up Capistrano 3 for deployment to my production environment. I believe I have everything set up correctly, but I can't figure out how to push my local repo to my production server. I don't have my repo on GitHub or another such site and would like to keep it local. I receive the following error message when I run <code>cap production deploy</code>.</p>
  
  <blockquote>
    <p>SSHKit::Runner::ExecuteError: Exception while executing as
    myappuser@myappname.website.com: git exit status: 128 git stdout:
    Nothing written git stderr: fatal: No remote configured to list refs
    from.</p>
    
    <p>SSHKit::Command::Failed: git exit status: 128 git stdout: Nothing
    written git stderr: fatal: No remote configured to list refs from.</p>
    
    <p>Tasks: TOP => git:check (See full trace by running task with --trace)
    The deploy has failed with an error: Exception while executing as
    myappuser@myappname.website.com: git exit status : 128 git stdout:
    Nothing written git stderr: fatal: No remote configured to list refs
    from.</p>
  </blockquote>
  
  <p>Here's my <code>config\deploy.rb</code> file:</p>
  
  <pre><code># config valid only for current version of Capistrano
  lock '3.4.0'
  
  set :application, 'myappname
  set :deploy_user, 'myappuser'
  set :repo_url, "file:///C:/Users/me/Documents/repo/myappname.git"
  
  # setup rvm.
  set :rbenv_type, :user
  set :rbenv_ruby, '2.1.5-p273'
  set :rbenv_prefix, "RBENV_ROOT=#{fetch(:rbenv_path)} RBENV_VERSION=#{fetch(:rbenv_ruby)} #{fetch(:rbenv_path)}/bin/rbenv exec"
  set :rbenv_map_bins, %w{rake gem bundle ruby rails}
  
  set :assets_roles, [:app]
  
  # Default value for :scm is :git
  set :scm, :git
  
  # Default value for :linked_files is []
  set :linked_files, %w{config/database.yml config/application.yml}
  
  # Default value for linked_dirs is []
  set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
  
  # Default value for keep_releases is 5
  set :keep_releases, 5
  
  # which config files should be copied by deploy:setup_config
  # see documentation in lib/capistrano/tasks/setup_config.cap
  # for details of operations
  set(:config_files, %w(
    nginx.conf
    application.yml
    database.yml
    unicorn.rb
    unicorn_init.sh
  ))
  
  # which config files should be made executable after copying
  # by deploy:setup_config
  set(:executable_config_files, %w(
    unicorn_init.sh
  ))
  
  # files which need to be symlinked to other parts of the
  # filesystem. For example nginx virtualhosts, log rotation
  # init scripts etc. The full_app_name variable isn't
  # available at this point so we use a custom template {{}}
  # tag and then add it at run time.
  set(:symlinks, [
    {
      source: "nginx.conf",
      link: "/etc/nginx/sites-enabled/{{full_app_name}}"
    },
    {
      source: "unicorn_init.sh",
      link: "/etc/init.d/unicorn_{{full_app_name}}"
    },
    {
      source: "log_rotation",
      link: "/etc/logrotate.d/{{full_app_name}}"
    }
  ])
  
  namespace :deploy do
    # compile assets locally then rsync
    after :finishing, 'deploy:cleanup'
  end
  </code></pre>
  
  <p>All of the answers I found didn't have a solution or were for Capistrano 2, so I am wondering if the options have changed. Any help would be greatly appreciated!</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>I've made some progress, but it's still not reading my local repo. Here's the error message:</p>
  
  <blockquote>
    <p>SSHKit::Command::Failed: git exit status: 128 git stdout: Nothing
    written git stderr: fatal: '/C:/Users/me/Documents/repo/myappname.git'
    does not appear to be a git repository fatal: Could not read from
    remote repository.</p>
    
    <p>Please make sure you have the correct access rights and the repository
    exists.</p>
  </blockquote>
  
  <p>I've tried all different path combinations for my repo. My git repo is at the following path: <code>C:/Users/me/Documents/repo/myappname</code>. Is there a specific way to reference my local repo?</p>