Forum: Ruby on Rails Images not showing up

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.
Vince W. (Guest)
on 2006-06-07 05:44
I moved my working rails app from one server to another and suddenly my
images are not showing up.  In the production log I see this:

ActionController::RoutingError (Recognition failed for
"/images/header.jpg"):
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:488:in
`recognition_failed'
    /usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:478:in
`recognize!'

It looks like it's looking in "/images" instead of "../images" or
whatever.  Is there any way to fix this?
ajaya a. (Guest)
on 2006-06-07 06:08
Vince W. wrote:
> I moved my working rails app from one server to another and suddenly my
> images are not showing up.  In the production log I see this:
>
> ActionController::RoutingError (Recognition failed for
> "/images/header.jpg"):
> 
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:488:in
> `recognition_failed'
> 
/usr/lib/ruby/gems/1.8/gems/actionpack-1.12.1/lib/action_controller/routing.rb:478:in
> `recognize!'
>
> It looks like it's looking in "/images" instead of "../images" or
> whatever.  Is there any way to fix this?

My experience with this thing is to convert all html img tag to
image_tag.  This has saved me these headaches..

ajay
Vince W. (Guest)
on 2006-06-07 06:38
I don't think that's my issue.  I'm also fairly certain it's not
permissions based.  I went to the images directory via my web browser
(foo.com/images) and, instead of seeing the images listed, I get a
directory listing like so:

Index of /images/
Name	Last Modified	Size	Type
Parent Directory/	 	-  	Directory
C/	2006-Jun-05 16:55:14	-  	Directory
desktop-base/	2006-Jun-05 17:04:25	-  	Directory


No idea why I would see C/ or desktop-base.. I have no idea where those
dirs might be located on my server.  This is a ubuntu dapper install
(fresh) running lighttpd.

-Vince
Vince W. (Guest)
on 2006-06-07 06:40
Edit:

those directories are in /usr/share/images.. so for some reason my rails
app is looking for images in /usr/share/images instead of
/pathto/rails/app/public/images

Anyone know why that might be happening?
Ray B. (Guest)
on 2006-06-07 20:21
(Received via mailing list)
Vince W. wrote:
> Edit:
>
> those directories are in /usr/share/images.. so for some reason my rails
> app is looking for images in /usr/share/images instead of
> /pathto/rails/app/public/images
>
> Anyone know why that might be happening?
>

This is probably a setting on your webserver that points any url
containing /images to that directory.

I don't understand why this would result in the routing errors that you
originally reported though.

--

Ray
This topic is locked and can not be replied to.