0

I've got a staging app on heroku. The app works if I leave the RACK_ENV set as production, but if I set it to staging the app crashes (Error H10 (App crashed)) - that's all the info I get...

My app is a Padrino app, and I'm using RACK_ENV to set some things like the base url to use in emails etc. I did a search in my code for RACK_ENV, and it looks like everything is set properly based on the different possible values.

I saw in the logs it said 'No logging configuration for :staging found, falling back to :production' - I don't know if that is to do with the problem though, as that message wasn't near the failure message.

Anyone know what might be going on?

Thanks :)

Louis Sayers
  • 2,162
  • 3
  • 30
  • 53

2 Answers2

0

OK... I take it back - turns out I missed one of my DB configurations... FAIL!

Louis Sayers
  • 2,162
  • 3
  • 30
  • 53
0

True, you need to update config with your new environment. I had a problem with production env, so I added this:

# config/database.rb
postgres = URI.parse(ENV['DATABASE_URL'] || '')

ActiveRecord::Base.configurations[:production] = {
  :adapter  => 'postgresql',
  :encoding => 'utf8',
  :database => postgres.path[1..-1], 
  :username => postgres.user,
  :password => postgres.password,
  :host     => postgres.host
}
Stefan Huska
  • 547
  • 1
  • 7
  • 13