Skip to content
This repository has been archived by the owner on Dec 7, 2021. It is now read-only.

prefix config parameter doesn't work #56

Open
viralshah opened this issue Sep 28, 2012 · 5 comments
Open

prefix config parameter doesn't work #56

viralshah opened this issue Sep 28, 2012 · 5 comments

Comments

@viralshah
Copy link

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:inGET /: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:incompile!'
/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:inroute!'
/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:inroute!'
/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:incatch'
/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:inroute!'
/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:inroute!'
/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:incall!'
/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:incatch'
/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:incall!'
/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:incall'
/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:incall'
/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:incall'
/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:incall'
/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:inprocess_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:inspawn_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:inload'
/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.

@keymon
Copy link
Collaborator

keymon commented Feb 10, 2013

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.

@falkenbt
Copy link
Collaborator

👍

@tubit
Copy link
Contributor

tubit commented Mar 28, 2013

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 #92

Cheers
Dennis

@keymon
Copy link
Collaborator

keymon commented Mar 28, 2013

We should update the configuration to explain this. after that I will close this ticket.

@tubit
Copy link
Contributor

tubit commented Mar 29, 2013

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants