Skip to content

Instantly share code, notes, and snippets.

@myfashionhub
Created May 22, 2014 03:35
Show Gist options
  • Save myfashionhub/e32cb0c49cc45c7e7c8c to your computer and use it in GitHub Desktop.
Save myfashionhub/e32cb0c49cc45c7e7c8c to your computer and use it in GitHub Desktop.
Rspec error: Relation table does not exist
$ rspec
F
Failures:
1) Fashionista has a username
Failure/Error: fashionista = Fashionista.new(username: 'myfashionhub')
ActiveRecord::StatementInvalid:
PG::UndefinedTable: ERROR: relation "fashionistas" does not exist
LINE 5: WHERE a.attrelid = '"fashionistas"'::regclass
^
: SELECT a.attname, format_type(a.atttypid, a.atttypmod),
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod
FROM pg_attribute a LEFT JOIN pg_attrdef d
ON a.attrelid = d.adrelid AND a.attnum = d.adnum
WHERE a.attrelid = '"fashionistas"'::regclass
AND a.attnum > 0 AND NOT a.attisdropped
ORDER BY a.attnum
# ./spec/models/fashionista_spec.rb:6:in `block (2 levels) in <top (required)>'
Finished in 0.00461 seconds
1 example, 1 failure
Failed examples:
rspec ./spec/models/fashionista_spec.rb:5 # Fashionista has a username
Randomized with seed 23312
@myfashionhub
Copy link
Author

config/database.yml

default: &default
  adapter: postgresql
  encoding: unicode
  # For details on connection pooling, see rails configuration guide
  # http://guides.rubyonrails.org/configuring.html#database-pooling
  pool: 5

development:
  <<: *default
  database: fashionize_development


test:
  <<: *default
  database: fashionize_test

production:
  <<: *default
  database: fashionize_production
  username: fashionize
  password: <%= ENV['FASHIONIZE_DATABASE_PASSWORD'] %>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment