Forum: Ruby on Rails Relative paths in Webrick vs. 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.
Reuven M. Lerner (Guest)
on 2006-02-16 11:01
(Received via mailing list)
Hi, everyone.  I've got a development server running Webrick, and a
production server running under lighttpd.  The following two lines of
code work just fine in the development server, but bombs out on the
production server with a "file not found" error:

    label_base_jpeg = "app/views/price_books/label.jpg"
    canvas =
Magick::ImageList.new(label_base_jpeg)

My guess is that lighttpd sets the current working directory to
something different from Webrick, leading to different interpretations
of the relative path in the code.  Is this the case?  Should it be?

In any event, what path can/should I use to ensure compatibility across
the different versions of my application?

Thanks,

Reuven
Norman T. (Guest)
on 2006-02-16 11:31
(Received via mailing list)
Am Donnerstag, den 16.02.2006, 02:59 -0600 schrieb Reuven M. Lerner:
>     label_base_jpeg = "app/views/price_books/label.jpg"

> In any event, what path can/should I use to ensure compatibility across
> the different versions of my application?

label_base_jpeg = "#{RAILS_ROOT}/app/views/price_books/label.jpg"

--
Norman T.

http://blog.inlet-media.de
This topic is locked and can not be replied to.