What is ‘$:.unshift File.dirname(__FILE__)’ doing?

It’s adding the current file’s directory to the load path. $: represents the load path (which is an array) and unshift prepends to the beginning of the array.

The reason it’s there (and at the top) is so that all those requires needn’t worry about the path.

Leave a Comment

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