2

I've had some problems running an app on Heroku. It uses Sinatra and Datamapper. The full project is here: https://github.com/pixelwolf/phonedb

The problem happens when I deploy the app, all goes well, until I go to the url, where I get an "Application Error" page. I have also push the SQLite3 database using heroku db:push sqlite://database.db

Here are the logs from running heroku logs: https://gist.github.com/1439777

  • Sorry, I don't know the answer but I did spot a minor, unrelated error in your code. On line 74 of main.rb you've misspelled 'email' :email => params[:emial] – conbask Dec 06 '11 at 20:44

2 Answers2

4

You have to configure your database in datamapper with a line like this

DataMapper.setup(:default, ENV['DATABASE_URL'] || 'sqlite3://my.db')

That was from heroku's website. http://devcenter.heroku.com/articles/database That will configure datamapper to continue to allow you to use sqlite3 on your local machine but switches to Heroku's postgres DB when the application is used there.

Also, Tom Anderson is correct, you need to add the dm-postgres-adapter gem to your Gemfile. I also added the pg gem as well, I'm not sure if that was necessary though.

wuliwong
  • 4,238
  • 9
  • 41
  • 69
3

The error page has the line:

`require': no such file to load -- dm-postgres-adapter

You can only use postgres on heroku. So likely you are not accounting for that in some way. You can develop with sqlite on your machine, but you then need to arrange a few things to make it all work, plus you need to not use any sqlite or postgres only features.

Community
  • 1
  • 1
Tom Andersen
  • 7,132
  • 3
  • 38
  • 55