Forum: Ruby on Rails /public recognition failed on lighttpd

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
9650515c4c5d1bd8680195d6f5d072e8?d=identicon&s=25 fero (Guest)
on 2007-02-08 18:05
hello. please help.

my app is working under apache/cgi. i switched to lighttpd and
everything works except loading stylesheets and images (and probably
other content in /public directory). the paths in html are correct. when
i typed images/stylesheets into browser manually, i got recognition
failed error. got idea?

thanks. fero.
72eb65fa089082d3bd8b38a5596ad331?d=identicon&s=25 Keynan Pratt (keynan)
on 2007-02-08 18:18
please post

the tree dump of you file system from the public dir,
the contents of the head tag in the rendered html file and
the head tag of your ruby template
9650515c4c5d1bd8680195d6f5d072e8?d=identicon&s=25 fero (Guest)
on 2007-02-08 18:41
here you are. but when image url manualy it should work, not recognition
error. am i correct? so:

(the application is on http://www.websupport.sk/icct.sk/ic1/public_entry
(public_entry is controller))

> the tree dump of you file system from the public dir:

.:
404.html
500.html
500.jpg
banner
csshover.htc
data_development
data_production
dispatch.cgi
dispatch.fcgi
dispatch.rb
dispatch2.fcgi
fakof.txt
fastcgi.server
favicon.ico
images
index.html
javascripts
nice_error.rhtml
robots.txt
static
stylesheets

./banner:
baner_meta.swf

./images:
500-transparent.gif
... (many images here ...)

./javascripts:
application.js
controls.js
dragdrop.js
effects.js
prototype.js

./static:
404.rhtml
500.rhtml
info.rhtml
info_en
info_sk
interactive.rhtml
sections

./static/info_en:

./static/info_sk:
2006.rhtml
about.rhtml
space.rhtml
staff.rhtml
web.rhtml

./static/sections:
divadlo.rhtml
film.rhtml
hudba.rhtml
inkubator.rhtml
literatura.rhtml
tanec.rhtml
visual.rhtml

./stylesheets:
admin.css
advanced_layout.css
common.css
dynamic.css
public2.css
scaffold.css
zana

./stylesheets/zana:
centrum-male.gif
...

./stylesheets/zana/menu:
01.gif
02.gif
...

./stylesheets/zana/pict:
divadlo.gif
...

./stylesheets/zana/sekcie:
01.gif
...

> the contents of the head tag in the rendered html file and:

<title>IC Culture train: News</title>
  <link href="/icct.sk/ic1/stylesheets/scaffold.css?1169744071"
media="all" rel="Stylesheet" type="text/css" />
<link href="/icct.sk/ic1/stylesheets/common.css?1169744071" media="all"
rel="Stylesheet" type="text/css" />
<link href="/icct.sk/ic1/stylesheets/dynamic.css?1170181359" media="all"
rel="Stylesheet" type="text/css" />
<link href="/icct.sk/ic1/stylesheets/public2.css?1170853442" media="all"
rel="Stylesheet" type="text/css" />
  <meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=windows-1250" />
  <meta http-equiv="imagetoolbar" content="no" />
  <meta name="description" content="Centrum súčasných umení, Košice.">
  <meta name="keywords" content="umenie, kultúra, košice, priestor,
divadlo, film, hudba, tanec, koncert, literatúra, workshop, dielňa">
  <link rel="shortcut icon" href="/favicon.ico" />

> the head tag of your ruby template

  <title><%= @title %></title>
  <%= stylesheet_link_tag "scaffold", "common", "dynamic", "public2",
:media => "all" %>
  <meta http-equiv="Content-Type" content="application/xhtml+xml;
charset=windows-1250" />
  <meta http-equiv="imagetoolbar" content="no" />
  <meta name="description" content="Centrum súčasných umení, Košice.">
  <meta name="keywords" content="umenie, kultúra, košice, priestor,
divadlo, film, hudba, tanec, koncert, literatúra, workshop, dielňa">
  <link rel="shortcut icon" href="/favicon.ico" />
72eb65fa089082d3bd8b38a5596ad331?d=identicon&s=25 Keynan Pratt (keynan)
on 2007-02-08 18:59
so here is where I see a problem.

your stylesheets are found at "/stylesheets/file.css" .
However, you
are trying to access them at  "/icct.sk/ic1/stylesheets/file.css"


I don't know why your stylesheet_link_tag function is getting this wrong
I can only assume it is to do with your configuration or rails version.

till you can fix this problem I would just hack through by adding these
two dirs in public (/icct.sk/ic1/) which I pressume is your home dir or
app_root.

However the real problem is probably in you enviroments.rb
9650515c4c5d1bd8680195d6f5d072e8?d=identicon&s=25 fero (Guest)
on 2007-02-08 19:22
no no no.... /icct.sk/ic1 is request.relative_url_root ... so this
should be good... path are good... when i am on cgi, i type to browser
for example

http://websupport.sk/icct.sk/ic1/images/something.gif - it works

on lighttpd i got RECOGNITION FAILED.

there is the problem, i assume, and thats why i cannot see images and
stylesheets on the page.
72eb65fa089082d3bd8b38a5596ad331?d=identicon&s=25 Keynan Pratt (keynan)
on 2007-02-08 19:33
fero wrote:
> no no no.... /icct.sk/ic1 is request.relative_url_root ... so this
> should be good... path are good... when i am on cgi, i type to browser
> for example
>
> http://websupport.sk/icct.sk/ic1/images/something.gif - it works
>
> on lighttpd i got RECOGNITION FAILED.
>
> there is the problem, i assume, and thats why i cannot see images and
> stylesheets on the page.

tell you what hard code a link tag that doesn't have /icct.sk/ic1 and
see what happens
72eb65fa089082d3bd8b38a5596ad331?d=identicon&s=25 Keynan Pratt (keynan)
on 2007-02-08 19:35
scratch that I see what your saying
72eb65fa089082d3bd8b38a5596ad331?d=identicon&s=25 Keynan Pratt (keynan)
on 2007-02-08 19:41
and no it does not work
9650515c4c5d1bd8680195d6f5d072e8?d=identicon&s=25 fero (Guest)
on 2007-02-08 21:24
anybody help! ;) i am pretty desperated and deadline coming closer :)
E13ea23a8a7e852bc7bf1952dff3d7b8?d=identicon&s=25 Matt Davies (vanderkerkoff)
on 2007-02-15 12:01
fero wrote:
> anybody help! ;) i am pretty desperated and deadline coming closer :)

Fero

Did you get any help with this?  I'm getting the same problem
Bbc0b8ec17b04945dfdfbf59fe19f898?d=identicon&s=25 eggman2001 (Guest)
on 2007-12-19 17:47
(Received via mailing list)
Matt - were you able to solve this? I believe it's an issue of using
relative_root_url with lighttpd but I haven't been able to find a
solution yet.

On Feb 15, 6:01 am, Matt Davies <rails-mailing-l...@andreas-s.net>
E13ea23a8a7e852bc7bf1952dff3d7b8?d=identicon&s=25 Matt Davies (vanderkerkoff)
on 2007-12-21 16:39
eggman2001 wrote:
> Matt - were you able to solve this? I believe it's an issue of using
> relative_root_url with lighttpd but I haven't been able to find a
> solution yet.
>
> On Feb 15, 6:01 am, Matt Davies <rails-mailing-l...@andreas-s.net>

Hi eggman2001

We did in a way, we moved to nginx and mongrel

Much better mate.

Sorry I can't be of more assistance.
This topic is locked and can not be replied to.