I am trying to deploy a simple app to Heroku (Sinatra and using DataMapper for the ORM), and I am getting these errors whenever I try to submit my form:
2011-08-03T22:52:05+00:00 heroku[router]: GET pure-mist-880.heroku.com/public/css/raffler.css dyno=web.1 queue=0 wait=0ms service=4ms status=404 bytes=18
2011-08-03T22:52:06+00:00 heroku[nginx]: GET /public/css/raffler.css HTTP/1.1 | 12.185.40.153 | 340 | http | 404
2011-08-03T22:52:15+00:00 app[web.1]: DataObjects::SyntaxError - ser=jjimxarsyb&password=2QbwU-iBQ6IckNTQqQ05&host=ec2-107-20-254-131.compute-1.amazonaws.com&port=&path=/jjimxarsyb&query=&fragment=&adapter=postgres:
2011-08-03T22:52:15+00:00 app[web.1]: /app/.gems/gems/dm-do-adapter-1.1.0/lib/dm-do-adapter/adapter.rb:114:in `execute_non_
...
2011-08-03T22:52:16+00:00 heroku[nginx]: POST / HTTP/1.1 | 12.185.40.153 | 297 | http | 500
The setup line I’m currently using is (taken from the Heroku DevCenter):
DataMapper.setup(:default, ENV['DATABASE_URL'] || 'sqlite3://#{Dir.pwd}/entries.db')
EDIT:
I added dm-do-adapter to my .gems file and that resolved that issue. Now, when I submit my form, I’m still presented with “Internal Server Error” in the browser, and my logs only show:
2011-08-04T01:19:30+00:00 heroku[router]: GET pure-mist-880.heroku.com/ dyno=web.1 queue=0 wait=0ms service=54ms status=200 bytes=919
2011-08-04T01:19:30+00:00 heroku[nginx]: GET / HTTP/1.1 | 71.199.2.204 | 1218 | http | 200
2011-08-04T01:19:31+00:00 heroku[router]: GET pure-mist-880.heroku.com/public/css/raffler.css dyno=web.1 queue=0 wait=0ms service=2ms status=404 bytes=18
2011-08-04T01:19:36+00:00 heroku[router]: POST pure-mist-880.heroku.com/ dyno=web.1 queue=0 wait=0ms service=35ms status=500 bytes=30
I don’t know why my .css file isn’t loading, and why it’s failing when I submit my form.
If you need more code snippets, let me know. Thank you in advance for any ideas.
“public” should not be apart of your routes anywhere.
From the sintra.rb intro documentation:
If you have your static assets placed elsewhere you can define it yourself as well:
Concerning the last line, do you have a
postroute for the root? Something like:Is this application working in a local dev environment?