Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku app fails silently on launch

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?

like image 314
Peeja Avatar asked Feb 26 '23 22:02

Peeja


1 Answers

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.

like image 87
Peeja Avatar answered Mar 05 '23 18:03

Peeja