gdash
gdash copied to clipboard
prefix config parameter doesn't work
when prefix is set. The app doesn't render correctly with errors for each JS file it tries to include.
Stack trace:
NoMethodError - undefined method list' for nil:NilClass: ./lib/gdash/sinatra_app.rb:128:in
GET /:category/:dash/?*'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:1264:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:1264:in
compile!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in []' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in
route!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:851:in route_eval' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:835:in
route!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:872:in process_route' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in
catch'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:870:in process_route' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:834:in
route!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in each' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:833:in
route!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:936:in dispatch!' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in
call!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in invoke' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in
catch'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:921:in invoke' /srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:769:in
call!'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:755:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in
call'
/srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/path_traversal.rb:16:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/json_csrf.rb:17:in
call'
/srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/base.rb:47:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-protection-1.2.0/lib/rack/protection/xss_header.rb:22:in
call'
/srv/gdash/vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/nulllogger.rb:9:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/rack-1.4.1/lib/rack/head.rb:9:in
call'
/srv/gdash/vendor/bundle/ruby/1.8/gems/sinatra-1.3.3/lib/sinatra/base.rb:99:in call' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:531:in
process_client'
/srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:606:in worker_loop' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:487:in
spawn_missing_workers'
/srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/lib/unicorn/http_server.rb:137:in start' /srv/gdash/vendor/bundle/ruby/1.8/gems/unicorn-4.3.1/bin/unicorn:121 /srv/gdash/bin/unicorn:16:in
load'
/srv/gdash/bin/unicorn:16
It seems that since the url path has the prefix in it, it can't look up static files (js etc) in the public folder.
Confirmed that it does not work. Completely broke. Not sure how to fix it and if it is easy, I guess we can just drop the feature and remove it from the documentation.
:+1:
I'm using gdash with a configured prefix, running with mod_passenger in apache.
Part of my apache configuration:
RackBaseURI /gdash
<Directory "/var/www/gdash">
AllowOverride all
Options -MultiViews
</Directory>
And in my gdash.yaml:
:prefix: "/gdash"
Working without problems. That's the reason for my pull request https://github.com/ripienaar/gdash/pull/92
Cheers Dennis
We should update the configuration to explain this. after that I will close this ticket.
Please mind that /var/www/gdash is a symlink to the gdash/public folder. I think that's important.
lrwxrwxrwx 1 www-data www-data 19 Jun 1 2012 gdash -> /opt/gdash/public