Ruby, Sinatra, DataMapper, and Heroku.what am I missing?

B

Brandon G.

All I'm trying to do is deploy an app I made using Heroku, because it
seemed simple enough when I read the instructions on various sites
explaining how to do this.

1.)Make a heroku account and install it
2.)Make a config.ru file in the root directory of the project containing

require 'movies' #movies is the name of my app
run Sinatra::Application

3.)Create the app on Heroku ($ heroku create)
4.) Use git and push the app to Heroku ($ git push heroku master)

I do all of this, and my app is being pushed to Heroku, but all I get is
an application error when I load the URL in a browser. So I run $ heroku
logs, and just get something telling me that it crashed, not giving me a
clue as to why. I was starting to think maybe it had to do with the
database? So I decided to try deploying a simple "hello world" app using
these same steps and I get the exact same error. What am I missing here?
I even tried using Bundler to make sure it gets all the required gems.

Link to github repository is https://github.com/bgerke/Ruby-Project for
anyone who is interested in helping me.

Attachments:
http://www.ruby-forum.com/attachment/6218/Ruby-Project.zip
 
B

Brandon G.

I decided to add gem 'dm-sqlite-adapter' to the gemfile and for some
reason this fixed my last problem. It's up and working now. ^_^
 
B

Brandon G.

Okay it's not really working I got excited and didn't bother testing it
after I saw something appear on each page. I get an internal server
error when attempting to submit anything from the form.

DataObjects::ConnectionError - attempt to write a readonly database:

How would I change it to a read/write?

PS: Tried to add this to the last post, but took just a hair too long.
Didn't realize you had to make edits within 15 minutes.

Attachments:
http://www.ruby-forum.com/attachment/6221/herokuLogs3.txt
 
R

Roger Braun

2011/5/23 Brandon G. said:
Okay it's not really working I got excited and didn't bother testing it
after I saw something appear on each page. I get an internal server
error when attempting to submit anything from the form.

DataObjects::ConnectionError - attempt to write a readonly database:

How would I change it to a read/write?

You can't use SQLite on Heroku, you have to use their PostgreSQL
database. Instead of

Datamapper.setup:)default, "sqlite:some.db")

use

Datamapper.setup:)default, ENV["DATABASE_URL"] || "sqlite:some.db")

This will work both locally and on Heroku. You will also need to add
dm-postgres-adapter to your Gemfile.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,756
Messages
2,569,535
Members
45,008
Latest member
obedient dusk

Latest Threads

Top