The following .rb
script runs fine if excuting at the script's folder:
db = YAML::load(File.open('db.yml'))
ActiveRecord::Base.establish_connection(db)
The File.open
will fail if the script is running outside the script folder. How can I supply the script's path to db.yml
? Thanks!