I'm trying to deploy an app on Heroku, and I haven't gotten it running yet. I see the Rails 500 page ("We're sorry, but something went wrong"), but when I heroku logs
I see nothing interesting:
==> exceptional.log <==
# Logfile created on Tue Nov 02 11:27:18 -0700 2010 by logger.rb
[INFO] (init.rb:21) Tue Nov 02 18:27:18 UTC 2010 - Loading Exceptional 2.0.26 for 2.3.5
==> dyno-2858334.log <==
>> Thin web server (v1.2.6 codename Crazy Delicious)
>> Maximum connections set to 1024
>> Listening on 0.0.0.0:15336, CTRL+C to stop
==> production.log <==
# Logfile created on Tue Nov 02 11:27:17 -0700 2010
As you can see, I've installed the Exceptional addon, and Exceptional hasn't reported any exceptions.
What might fail silently during app launch on Heroku?
The answer: our app was using Sass, which attempts to write its compiled CSS to the public/
directory. On Heroku, that's on the read-only filesystem. Instead, I installed Hassle, which puts compiled Sass CSS under tmp/
, which is read-write.
Heroku support discovered the problem by setting the environment to development
, which allowed the error to be logged:
heroku config:add RACK_ENV=development
The Hassle site recommends adding Hassle as a plugin, but I prefer not to use plugins when I can just use gems. I got it to work by adding it to the Gemfile, and adding this to environment.rb
:
# existing requires
# ...
require 'hassle'
Rails::Initializer.run do |config|
# ...
# existing config
# ...
config.middleware.use Hassle
end
Now it just works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With