Relative paths in Webrick vs. lighttpd


#1

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


#2

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