Note To Self: Beware Relative Paths
When loading my own Ruby sources into Rails in environment.rb, don’t do this:
require 'my_library'
Do this:
require File.join(File.dirname(__FILE__), '../lib/my_library')
Especially when using a cheap host that:
- starts up Rails in a directory that isn’t the app’s root
- doesn’t give you access to the error logs
Andy Stewart, 16 August 2007
Posted in Deployment, Notes To Self, Rails

0 Comments
Jump to comment form