rails4 - Psych::BadAlias: Unknown alias: test

I don't believe you can alias test, development, or production as they are assigned based on the environment you boot in (if environment is production, the production settings will be applied). The issue is that if this were to work, cucumber would only be usable in the test environment.

I used something akin to the below:

  base: &base
     adapter: mysql2
     host: address.com
     encoding: utf8
     adapter: mysql2
     username: xxxxxx
     password: xxxxxx

  development:
     database: db_dev
     <<: *base

  test:
     database: db_test
     <<: *base

  production:
     database: db_prod
     <<: *base

  cucumber:
     database: cucumber
     <<: *base

You can avoid this problem by passing aliases: true argument to YAML.safe_load method:

YAML.safe_load(File.read('config/database.yml'), aliases: true)