title: Why is Capistrano deploying my project in "development" environment?
body: <p>I have the following files set up for my capistrano configuration. When I deploy my project with the following command it deploys to the server, but the <code>Rails.env</code> is set to 'deployment'.  How can I have it properly set to 'production'?</p>
  
  <p><strong>deploy command</strong></p>
  
  <pre><code>cap production deploy
  </code></pre>
  
  <p><strong>deploy.rb</strong></p>
  
  <pre><code>set :application, 'project'
  set :repo_url, 'git@github.com:AccountName/project.git'
  set :deploy_to, '/home/deploy/project'
  
  set :linked_files, %w{config/database.yml}
  set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system}
  
  namespace :deploy do
  
    desc 'Restart application'
    task :restart do
      on roles(:app), in: :sequence, wait: 5 do
        execute :touch, release_path.join('tmp/restart.txt')
      end
    end
  
    after :publishing, 'deploy:restart'
    after :finishing, 'deploy:cleanup'
  end
  </code></pre>
  
  <p><strong>config/deploy/production.rb</strong></p>
  
  <pre><code>set :stage, :production
  set :branch, 'master'
  set :rails_env, 'production'
  
  server '127.0.0.1:4400', user: 'deploy', roles: %w{web app}
  </code></pre>
  
  <p><strong>nginx.conf</strong></p>
  
  <pre><code>server {
      listen 80;
      server_name ip_address;
      rails_env production;
      root /path/to/app/public;
      passenger_enabled on;
  }
  </code></pre>
  
  <p><strong>sites-available/project</strong></p>
  
  <pre><code>server {
     listen 80 default_server;
     server_name ip_address;
     passenger_enabled on;
     root /path/to/app/public;
  }
  </code></pre>