0

UPDATE
I know now (from running heroku run bash and ls -la) that indeed the config directory is missing after deployment to heroku. It is however present in local repository.


.gitignore

/.bundle

# Ignore the default SQLite database.
/db/*.sqlite3

# Ignore all logfiles and tempfiles.
/log/*.log
*.log
/tmp

After I push my application to heroku I get a LoadError for /app/config/environment, which has not happened in previous releases. No changes to config.ru were made. The file config/environment.rb is present.

I tried a rollback, but couldn't because the previous release has a different add-on set.

How can I solve this error?

Heroku logs:


2012-05-09T03:59:15+00:00 heroku[slugc]: Slug compilation started
2012-05-09T04:00:36+00:00 heroku[api]: Release v48 created by xxx
2012-05-09T04:00:36+00:00 heroku[api]: Deploy ac5eee6 by xxx
2012-05-09T04:00:36+00:00 heroku[web.1]: State changed from crashed to created
2012-05-09T04:00:36+00:00 heroku[web.1]: State changed from created to starting
2012-05-09T04:00:36+00:00 heroku[slugc]: Slug compilation finished
2012-05-09T04:00:44+00:00 heroku[web.1]: Starting process with command `bundle exec thin start -p 6745`
2012-05-09T04:00:47+00:00 app[web.1]: /app/config.ru:3:in `require': no such file to load -- /app/config/environment (LoadError)
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/config.ru:3:in `block in <main>'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `instance_eval'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/rack-1.4.1/lib/rack/builder.rb:51:in `initialize'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/config.ru:1:in `new'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/config.ru:1:in `<main>'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:36:in `eval'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:36:in `load'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/rack/adapter/loader.rb:45:in `for'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:169:in `load_adapter'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/controllers/controller.rb:73:in `start'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:185:in `run_command'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/lib/thin/runner.rb:151:in `run!'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/gems/thin-1.3.1/bin/thin:6:in `<top (required)>'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `load'
2012-05-09T04:00:47+00:00 app[web.1]:   from /app/vendor/bundle/ruby/1.9.1/bin/thin:19:in `<main>'
2012-05-09T04:00:47+00:00 app[web.1]: >> Using rack adapter
2012-05-09T04:00:48+00:00 heroku[web.1]: Process exited with status 1
2012-05-09T04:00:48+00:00 heroku[web.1]: State changed from starting to crashed

config.ru


# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment',  __FILE__)
run ItAngel::Application
yas4891
  • 4,774
  • 3
  • 34
  • 55

2 Answers2

0

With Release managment http://blog.heroku.com/archives/2010/11/17/releases/ every time you add or remove a config variable, it should create a new release, so you should be able to roll back to a previous release even if you had a different add-on set.

What do you have in your Procfile? Try specifying RACK_ENV like this:

web: bundle exec thin start -p $PORT -e $RACK_ENV

When you run git push heroku master does everything appear to work?

Schneems
  • 14,918
  • 9
  • 57
  • 84
  • hi. running `git push heroku master` does indeed seem to work just fine. I meanwhile learned that the whole `config` directory is missing on heroku (although there is no such line in .gitignore or .slugignore) – yas4891 May 09 '12 at 20:40
  • I have the same as your problem ... did you find a solution ? – simo Jul 31 '12 at 03:07
0

I have contacted heroku on a similar issue for my app, we discovered that removing the file .slugignore which is beside file .gitignore fixed the problem.

May be its the same case at your side, you can see my question here: why config folder is not pushed?

and see my answer to my question.

I hope this will help

Community
  • 1
  • 1
simo
  • 23,342
  • 38
  • 121
  • 218
  • hey Samir. Indeed, that was what "fixed" my problem - I forgot to answer my question. This is very unsatisfying though, because you obviously can't use .slugignore then. – yas4891 Aug 06 '12 at 19:08
  • I think heroku will work on this issue, as their technical support told me to remove the .slugignore, so they are aware of this! Happy to know that you fixed your problem though :-) – simo Aug 06 '12 at 20:07