title: cap production deploy fails with ActiveRecord::NoDatabaseError: FATAL: database "rails/rbwapp" does not exist
body: <p>I have an empty Rails application working on my development machine.
  I have been following the tutorial at <a href="https://gorails.com/deploy/ubuntu/20.04" rel="nofollow noreferrer">https://gorails.com/deploy/ubuntu/20.04</a> in order to deploy it to a new DigitalOcean ubuntu 20.04 droplet.</p>
  <p>I work my way through the entire entire tutorial and get to the step where I run the deploy:</p>
  <pre><code>ThinkPad-T570:~/rails/rbwapp$ cap production deploy  
  00:00 git:wrapper
        01 mkdir -p /tmp
      ✔ 01 rbw@64.225.88.53 0.110s
        Uploading /tmp/git-ssh-rbwapp-production-rbw.sh 100.0%
        02 chmod 700 /tmp/git-ssh-rbwapp-production-rbw.sh
      ✔ 02 rbw@64.225.88.53 0.063s
  
  00:00 git:check
        01 git ls-remote git@github.com:rwaddington/rbwapp.git HEAD
        01 0d717f41d83befe63856ddf6cfdf4d808519a1dc   HEAD
      ✔ 01 rbw@64.225.88.53 0.795s
  00:01 deploy:check:directories
        01 mkdir -p /home/rbw/rails/rbwapp/shared /home/rbw/rails/rbwapp/releases
      ✔ 01 rbw@64.225.88.53 0.059s
  00:01 deploy:check:linked_dirs
        01 mkdir -p /home/rbw/rails/rbwapp/shared/log /home/rbw/rails/rbwapp/shared/tmp/pids /home/rbw/rails/rbwapp/shared/tmp/cache /…
      ✔ 01 rbw@64.225.88.53 0.100s
  00:01 git:clone
        The repository mirror is at /home/rbw/rails/rbwapp/repo
  00:01 git:update
        01 git remote set-url origin git@github.com:rwaddington/rbwapp.git
      ✔ 01 rbw@64.225.88.53 0.107s
        02 git remote update --prune
        02 Fetching origin
      ✔ 02 rbw@64.225.88.53 0.820s
  00:02 git:create_release
        01 mkdir -p /home/rbw/rails/rbwapp/releases/20200828170348
      ✔ 01 rbw@64.225.88.53 0.106s
        02 git archive master | /usr/bin/env tar -x -f - -C /home/rbw/rails/rbwapp/releases/20200828170348
      ✔ 02 rbw@64.225.88.53 0.074s
  00:03 deploy:set_current_revision
        01 echo &quot;0d717f41d83befe63856ddf6cfdf4d808519a1dc&quot; &gt; REVISION
      ✔ 01 rbw@64.225.88.53 0.061s
  00:03 deploy:symlink:linked_dirs
        01 mkdir -p /home/rbw/rails/rbwapp/releases/20200828170348 /home/rbw/rails/rbwapp/releases/20200828170348/tmp /home/rbw/rails/…
      ✔ 01 rbw@64.225.88.53 0.102s
        02 rm -rf /home/rbw/rails/rbwapp/releases/20200828170348/log
      ✔ 02 rbw@64.225.88.53 0.060s
        03 ln -s /home/rbw/rails/rbwapp/shared/log /home/rbw/rails/rbwapp/releases/20200828170348/log
      ✔ 03 rbw@64.225.88.53 0.104s
        04 ln -s /home/rbw/rails/rbwapp/shared/tmp/pids /home/rbw/rails/rbwapp/releases/20200828170348/tmp/pids
      ✔ 04 rbw@64.225.88.53 0.055s
        05 ln -s /home/rbw/rails/rbwapp/shared/tmp/cache /home/rbw/rails/rbwapp/releases/20200828170348/tmp/cache
      ✔ 05 rbw@64.225.88.53 0.107s
        06 ln -s /home/rbw/rails/rbwapp/shared/tmp/sockets /home/rbw/rails/rbwapp/releases/20200828170348/tmp/sockets
      ✔ 06 rbw@64.225.88.53 0.065s
        07 ln -s /home/rbw/rails/rbwapp/shared/vendor/bundle /home/rbw/rails/rbwapp/releases/20200828170348/vendor/bundle
      ✔ 07 rbw@64.225.88.53 0.105s
        08 ln -s /home/rbw/rails/rbwapp/shared/.bundle /home/rbw/rails/rbwapp/releases/20200828170348/.bundle
      ✔ 08 rbw@64.225.88.53 0.061s
        09 ln -s /home/rbw/rails/rbwapp/shared/public/system /home/rbw/rails/rbwapp/releases/20200828170348/public/system
      ✔ 09 rbw@64.225.88.53 0.106s
        10 ln -s /home/rbw/rails/rbwapp/shared/public/uploads /home/rbw/rails/rbwapp/releases/20200828170348/public/uploads
      ✔ 10 rbw@64.225.88.53 0.063s
        11 ln -s /home/rbw/rails/rbwapp/shared/public/assets /home/rbw/rails/rbwapp/releases/20200828170348/public/assets
      ✔ 11 rbw@64.225.88.53 0.105s
  00:05 bundler:config
        01 $HOME/.rbenv/bin/rbenv exec bundle config --local deployment true
      ✔ 01 rbw@64.225.88.53 0.389s
        02 $HOME/.rbenv/bin/rbenv exec bundle config --local path /home/rbw/rails/rbwapp/shared/bundle
      ✔ 02 rbw@64.225.88.53 0.514s
        03 $HOME/.rbenv/bin/rbenv exec bundle config --local without development:test
      ✔ 03 rbw@64.225.88.53 0.607s
  00:07 bundler:install
        The Gemfile's dependencies are satisfied, skipping installation
  00:08 deploy:assets:precompile
        01 $HOME/.rbenv/bin/rbenv exec bundle exec rake assets:precompile
        01 yarn install v1.22.5
        01 [1/4] Resolving packages...
        01 [2/4] Fetching packages...
        01 info fsevents@2.1.3: The platform &quot;linux&quot; is incompatible with this module.
        01 info &quot;fsevents@2.1.3&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
        01 info fsevents@1.2.13: The platform &quot;linux&quot; is incompatible with this module.
        01 info &quot;fsevents@1.2.13&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
        01 [3/4] Linking dependencies...
        01 [4/4] Building fresh packages...
        01 Done in 13.85s.
        01 yarn install v1.22.5
        01 [1/4] Resolving packages...
        01 [2/4] Fetching packages...
        01 info fsevents@2.1.3: The platform &quot;linux&quot; is incompatible with this module.
        01 info &quot;fsevents@2.1.3&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
        01 info fsevents@1.2.13: The platform &quot;linux&quot; is incompatible with this module.
        01 info &quot;fsevents@1.2.13&quot; is an optional dependency and failed compatibility check. Excluding it from installation.
        01 [3/4] Linking dependencies...
        01 [4/4] Building fresh packages...
        01 Done in 7.12s.
        01 Compiling...
        01 Compiled all packs in /home/rbw/rails/rbwapp/releases/20200828170348/public/packs
        01 Hash: 666d45eeef50ba415ec8
        01 Version: webpack 4.44.1
        01 Time: 9726ms
        01 Built at: 08/28/2020 5:04:31 PM
        01                                         Asset       Size  Chunks                         Chunk Names
        01        js/application-dd6e88065a32b23f8e21.js   69.3 KiB       0  [emitted] [immutable]  application
        01     js/application-dd6e88065a32b23f8e21.js.br   15.3 KiB          [emitted]
        01     js/application-dd6e88065a32b23f8e21.js.gz   17.7 KiB          [emitted]
        01    js/application-dd6e88065a32b23f8e21.js.map    205 KiB       0  [emitted] [dev]        application
        01 js/application-dd6e88065a32b23f8e21.js.map.br     44 KiB          [emitted]
        01 js/application-dd6e88065a32b23f8e21.js.map.gz     51 KiB          [emitted]
        01                                 manifest.json  364 bytes          [emitted]
        01                              manifest.json.br  129 bytes          [emitted]
        01                              manifest.json.gz  142 bytes          [emitted]
        01 Entrypoint application = js/application-dd6e88065a32b23f8e21.js js/application-dd6e88065a32b23f8e21.js.map
        01 [0] (webpack)/buildin/module.js 552 bytes {0} [built]
        01 [1] ./app/javascript/packs/application.js 742 bytes {0} [built]
        01 [5] ./app/javascript/channels/index.js 205 bytes {0} [built]
        01 [6] ./app/javascript/channels sync _channel\.js$ 160 bytes {0} [built]
        01     + 3 hidden modules
        01
      ✔ 01 rbw@64.225.88.53 36.283s
  00:44 deploy:assets:backup_manifest
        01 mkdir -p /home/rbw/rails/rbwapp/releases/20200828170348/assets_manifest_backup
      ✔ 01 rbw@64.225.88.53 0.107s
        02 cp /home/rbw/rails/rbwapp/releases/20200828170348/public/assets/.sprockets-manifest-36bf47d96af8c04d2269f7a55275b52a.json /…
      ✔ 02 rbw@64.225.88.53 0.064s
  00:44 deploy:migrate
        [deploy:migrate] Run `rake db:migrate`
  00:44 deploy:migrating
        01 $HOME/.rbenv/bin/rbenv exec bundle exec rake db:migrate
        01 rake aborted!
        01 ActiveRecord::NoDatabaseError: FATAL:  database &quot;rails/rbwapp&quot; does not exist
  ... stackdump omitted ...
  </code></pre>
  <p>The error is correct in the sense that database &quot;rails/rbwapp&quot; doesn't exist, but it's also not supposed to. It should be looking for &quot;rbwapp_production&quot; (which does exist)</p>
  <p>I'm stuck. Any suggestions greatly appreciated...</p>