Setting Public folder with Trinidad Gem

186 views Asked by At

I'm running a rails application using the trinidad gem. I'm using the method that lets me use it with the Rack handler:

$ jruby -S rails s -p 80 

However, it gives me a bunch of 404 errors whenever I try to access something in the rails public/ folder. The readme seems to suggest that I add the --public PUBLIC_DIR option so that the server knows what to treat as a public folder, but when I add it to my call:

$ jruby -S rails s -p 80 --public /home/bdares/myproject/public

it gives me this error:

OptionParser::InvalidOption: invalid option: --public

Everything else in my views and asset pipeline are being served just fine, so I suppose I can just stick everything in an asset folder but I'd like to do it right if possible. Also, it would appear that since the public folder isn't being served properly, any precompiled assets would also not be found.

1

There are 1 answers

0
kares On BEST ANSWER

unfortunately the rack handler is really only there to "be" and does not support everything ... really should only use it for development if you require configuration of the defaults I recommend going for the "standard" mode (best if you go threadsafe!) where changing the public folder should work - although it might be expected to work relatively to your root (try master as well - I'm not sure now what's in the release) you can "sym-link" sub-folders into public using Trinidad's configuration (there's a sample in the README of check the wiki).