Closed thomasjedstrom closed 7 years ago
Hi @thomasjedstrom - what's your production database.yml look like? (Don't need the real values, but representative examples would help.)
default: &default
adapter: postgresql
encoding: unicode
pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %>
development:
<<: *default
database: abtesting_development
test:
<<: *default
database: abtesting_test
production:
<<: *default
database: abtesting_production
password: <%= ENV['ABTESTING_DATABASE_PASSWORD'] %>
Honestly I'm not totally sure how the communication to Postgres works here. Dokku is a lot like Heroku so there's a lot that goes on behind the scenes, but for the most part it usually just works. I'm fairly certain the password isn't actually doing anything but this is approximately how some of my other projects have looked so I just left it as is. What do you think?
Hm, just to confirm - does database access for other rails objects work? If you're including a password in the production config, you'll also need it in the vanity config.
However, if it's the same database (ie the app data is stored in the same database as the vanity data), then it's probably fine to piggy back on the same connection, in your vanity.yml:
production:
adapter: active_record
active_record_adapter: default
I think that second part was the issue. They're using the same database and while the database doesn't have a problem, I think maybe Vanity was seeing the password and getting hung up on it. Since it wasn't necessary anyways I nixed it. I also explicitly defined the adapter and active_record_adapter in vanity's production and it's running now. For science I should have done those one at a time to see which was the sticking point, but I'll at least post the side by side.
So, this was the old vanity.yml:
development: &default
adapter: active_record
active_record_adapter: postgresql
database: abtesting_development
test:
adapter: active_record
active_record_adapter: default
collecting: false
production:
<<: *default
database: abtesting_production
And here was the new vanity.yml that now works:
development: &default
adapter: active_record
active_record_adapter: postgresql
database: abtesting_development
test:
adapter: active_record
active_record_adapter: default
collecting: false
production:
adapter: active_record
active_record_adapter: default
database: abtesting_production
Thanks Phil, I should have been able to trial and error that one out on my own, but thanks for walking it through with me.
Hey guys,
I'm running into an issue where everything works fine when running locally but seems to be unable to find the test once deployed. It seems strange because it looks as though Vanity is getting fired on line 4, but then collapses all together claiming it can't find the database. But again, it works fine when run locally. Any thoughts would be greatly appreciated.
Log
vanity.yml:
ApplicationController