Application error

4 views
Skip to first unread message

Jay Fallon

unread,
Nov 3, 2009, 11:36:52 AM11/3/09
to sinatrarb
I've managed to deploy a sinatra app to Rackspace, but I get
"Application error" when I restart the server. I've googled everywhere
but cannot seem to find a solution.

My setup is:

http://github.com/zapnap/retweet
Apache2
Passenger 2.2.5
Sinatra 0.9.4

I was able to see the app running after rackup config.ru, but now that
has gone to "Application error" as well.

Is there a config issue I should be aware of or has anyone had a
similar problem?

Thanks.

Jay Fallon

unread,
Nov 3, 2009, 12:43:32 PM11/3/09
to sinatrarb
Same issue on Heroku as well: Application Error

Ben Lovell

unread,
Nov 3, 2009, 12:44:31 PM11/3/09
to sina...@googlegroups.com
2009/11/3 Jay Fallon <jayf...@gmail.com>
What do you see in the apache/passenger logs? 

Rgds,
Ben

Jay Fallon

unread,
Nov 3, 2009, 2:56:32 PM11/3/09
to sinatrarb
This is what I get in /log/sinatra.log even after I ran rake
db:migrate. Is this a DataObjects issue?

DataObjects::SyntaxError - no such table: statuses:
lib/status.rb:31:in `random'
application.rb:35:in `GET /'/usr/lib/ruby/gems/1.8/gems/dm-
core-0.10.1/lib/dm-core/adapters/data_objects_adapter.rb:88:in
`execute_reader'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:88:in `read'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:266:in `with_connection'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/adapters/
data_objects_adapter.rb:84:in `read'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/repository.rb:
141:in `read'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/collection.rb:
1001:in `lazy_load'
/usr/lib/ruby/gems/1.8/gems/extlib-0.9.13/lib/extlib/lazy_array.rb:
408:in `method_missing'
/usr/lib/ruby/gems/1.8/gems/dm-core-0.10.1/lib/dm-core/collection.rb:
1348:in `method_missing'
./lib/status.rb:31:in `random'
./application.rb:35:in `GET /'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:779:in
`call'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:779:in
`route'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:474:in
`instance_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:474:in
`route_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:463:in
`route!'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:460:in
`catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:460:in
`route!'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:439:in
`each'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:439:in
`route!'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:555:in
`dispatch!'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:375:in
`call!'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:522:in
`instance_eval'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:522:in
`invoke'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:522:in
`catch'
/usr/lib/ruby/gems/1.8/gems/sinatra-0.9.4/lib/sinatra/base.rb:522:in
`invoke'

Jay Fallon

unread,
Nov 3, 2009, 4:09:57 PM11/3/09
to sinatrarb
Apparently I'm still in dev mode so I can only write tothe dev
database. Is there any way to change to production?

Ben Lovell

unread,
Nov 3, 2009, 5:55:08 PM11/3/09
to sina...@googlegroups.com
2009/11/3 Jay Fallon <jayf...@gmail.com>

Apparently I'm still in dev mode so I can only write tothe dev
database. Is there any way to change to production?


Are you explicitly setting dev mode anywhere as passenger should be defaulting the RACK_ENV to production?

You should be able to override this if you need to by using the following somewhere in your app before you actually do anything preferably:

ENV["RACK_ENV"] = "production"

But you should try to figure out why the RACK_ENV isn't already production too.

Rgds,
Ben 
Reply all
Reply to author
Forward
0 new messages