i thought i'd put together a fun little sinatra app to capture the
rainy day "meh" feeling on twitter, but haven't been able to get it up
and running on my server (ubuntu hardy,thin,rack,nginx).
since i do have other sinatra apps that are running successfully on
the same server, i i shrunk this sinatra application (http://
gist.github.com/21958) down to the bare minimum, and determined that
the problem is with use_in_file_templates!
-------
$:.unshift File.dirname(__FILE__) + '/sinatra/lib'
require 'rubygems'
require 'sinatra'
get '/' do
haml :index
end
use_in_file_templates!
__END__
@@ layout
= yield
@@ index
%div.title Hello world!!!!!
---
i have tried running the application as ruby meh.rb, and receive the
following error:
---
Params:
{}
Errno::ENOENT - No such file or directory - /home/deploy/meh/sinatra/
views/index.haml
../sinatra/sinatra/lib/sinatra.rb:568:in `read_template_file'
../sinatra/sinatra/lib/sinatra.rb:555:in `resolve_template'
../sinatra/sinatra/lib/sinatra.rb:530:in `render'
../sinatra/sinatra/lib/sinatra.rb:610:in `haml'
../sinatra/meh.rb:6
../sinatra/sinatra/lib/sinatra.rb:1263:in `instance_eval'
../sinatra/sinatra/lib/sinatra.rb:1263:in `dispatch'
../sinatra/sinatra/lib/sinatra.rb:1257:in `catch'
../sinatra/sinatra/lib/sinatra.rb:1257:in `dispatch'
/usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/commonlogger.rb:20:in
`call'
/usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/commonlogger.rb:20:in
`_call'
/usr/lib/ruby/gems/1.8/gems/rack-0.4.0/lib/rack/commonlogger.rb:13:in
`call'
../sinatra/sinatra/lib/sinatra.rb:1236:in `call'
../sinatra/sinatra/lib/sinatra.rb:1181:in `run_safely'
../sinatra/sinatra/lib/sinatra.rb:1181:in `synchronize'
../sinatra/sinatra/lib/sinatra.rb:1181:in `run_safely'
../sinatra/sinatra/lib/sinatra.rb:1234:in `call'
../sinatra/sinatra/lib/sinatra/rack/handler/mongrel.rb:60:in `process'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:159:in
`process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in `each'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:158:in
`process_client'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in
`initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:285:in `run'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in
`initialize'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `new'
/usr/lib/ruby/gems/1.8/gems/mongrel-1.1.5/lib/mongrel.rb:268:in `run'
../sinatra/sinatra/lib/sinatra/rack/handler/mongrel.rb:33:in `run'
../sinatra/sinatra/lib/sinatra.rb:117:in `run'
../sinatra/sinatra/lib/sinatra.rb:1471
../sinatra/meh.rb:9
---
when running the sinatra app over thin and rack, i receive the
following error:
---
"Internal Server Error"
---
in my thin log, i see:
---
>> Writing PID to /home/deploy/meh/server/thin.7655.pid
/home/deploy/meh/sinatra/sinatra/lib/sinatra.rb:21: warning: already
initialized constant POST_TUNNEL_METHODS_ALLOWED
/home/deploy/meh/sinatra/sinatra/lib/sinatra.rb:63: warning: already
initialized constant VERSION
/home/deploy/meh/sinatra/sinatra/lib/sinatra.rb:133: warning: already
initialized constant SPLAT
/home/deploy/meh/sinatra/sinatra/lib/sinatra.rb:228: warning: already
initialized constant DEFAULT_SEND_FILE_OPTIONS
/home/deploy/meh/sinatra/sinatra/lib/sinatra.rb:902: warning: already
initialized constant FORWARD_METHODS
>> Thin web server (v1.0.0 codename That's What She Said)
>> Maximum connections set to 1024
>> Listening on
127.0.0.1:7655, CTRL+C to stop
127.0.0.1 - - [04/Nov/2008 21:39:52] "GET / HTTP/1.0" 500 30 0.0485
--------------
if i avoid "use_in_file_templates!" and instead put dummy text inside:
---
get '/' do
"this works"
end
--------------
any tips, solutions?