Rails can't find public folder

software development

#1

I am having a weird problem with Ruby on Rails that’s driving me nuts. When I change htaccess to use fastcgi instead of cgi, all links to images, stylesheets and javascripts stop working because Rails can’t find the public folder anymore. The problem disappears as soon as I change htaccess back but CGI is just too slow to work with, so that’s not really an option.

Any ideas?


#2

It sounds like /public isn’t your document root. Check the wiki for more info:

http://wiki.dreamhost.com/index.php/Ruby_on_Rails

-Tom Wilcoxen
convergent arts


#3

[quote]It sounds like /public isn’t your document root.

[/quote]

Yeah, that was my first thought too. But that’s not the case.

Everything works fine in normal CGI mode (except that it’s really slow) but as soon as I chance htaccess to use dispatch.fcgi Rails can’t find the public folder anymore. When I switch back to dispatch.cgi it works fine again.

I can’t believe no one else has had this problem , it happens with all my sites.


#4

I’m experiencing the exact same problem. Any resolution??

Clint


#5

yeah, I was having the same problem.


#6

I have the same problem


#7

Guys,
I’m complete newbie in RoR/Dreamhost world, but I did something which worked for me. Initially when I edited .htaccess file to enable fcgi I uncommented example rewrite rule line which was enabling fcgi - in the script it was before line RewriteEngine on. When I moved RewriteRule to after RewriteEngine on images started to appear :slight_smile: