Is require File.expand_path(…, __FILE__) the best practice?

In Ruby 1.9.2 + require_relative is probably the more correct way to do it.

require was changed to not include your '.' directory for security reasons. require_relative was added to provide a local-file solution for modules relative to your calling script’s path.

You can search here on StackOverflow, particularly in “What is require_relative in Ruby?”, and the internets and find usage tricks and the why-for messages explaining how it came about.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)