Rails app works locally, crashes on Heroku Rails app works locally, crashes on Heroku heroku heroku

Rails app works locally, crashes on Heroku


I had the same thing. Turns out during development a spec had somehow gotten copied up into into the controllers folder. Didn't have any affect locally, but crashed cedar...


I think the problem might be in this line:

/app/.bundle/gems/ruby/1.8/gems/activesupport-3.1.0/lib/active_support/dependencies.rb:306:in `depend_on': No such file to load -- spec_helper (LoadError)

It seems that one of your initializers has require "spec_helper" in it (or loads a file elsewhere that does the same) and shouldn't. This might have to do with gems in your Gemfile that are in the :test group that don't get loaded by default on Heroku.

You might try running bundle install --without test development locally to reproduce how Heroku is installing the gems. Note that this will be the permanent way that bundle installs gems until you delete the ./.bundle/config file from your project, so you will want to do that afterwards once you've figured things out.

Hope this helps...


Had the same issue with passenger. The problem was a require in a model that depended on a lib. Adding the lib directory to autoload and removing all requires (found by fgrep 'require' -r app/) worked.