views:

121

answers:

2

I'm trying to deploy my first Rails app.

At first, I was getting the following error:

ActionView::TemplateError (Permission denied)

I set the permissions of the stylesheets folder to 777 (just for now until I work out what's going wrong) and the application started to work. However, it is not picking up any of the stylesheets (everything is displayed in plain text). If I view the source code and click the CSS links, I just get a blank page.

Javascripts however, seem to be working just fine.

VHost Config:

<VirtualHost *:80>
ServerName xxxx.xxx.com
DocumentRoot /home/myapp/public    
<Directory /home/myapp/public>
Allow from All
AllowOverride all             
Options -MultiViews           
</Directory>
</VirtualHost>

Can anyone help?

Any advice appreciated.

Thanks.

A: 

Anything interesting in your apache access logs? (locally, mine are here: /var/log/apache2/access_log)

Add in Order allow,deny and Allow from all. Many configs have their Directory value in quotes (though not required).

<VirtualHost *:80>
  ServerName domain.com
  ServerAlias www.domain.com
  DocumentRoot /var/www/domain.com/public
  <Directory "/var/www/domain.com/public">
        Options FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
  </Directory>
  RailsBaseURI /
</VirtualHost>

though I have local passenger setup with just

Order allow,deny
Allow from all
Options -MultiViews

And if it's your first rails app on OSX, may I recommend Passenger and the Passenger Preference Pane.

databyte
A: 

I managed to get this working in the end by removing the cache option from my stylesheets. It seems that the permissions weren't extending to the file that this created.

Dan