Executing File.expand_path("~/.payment.yml") in IRB works fine.
Just a hunch, but in what context is the failing code running? If the
failing code is running in a web application, $HOME/~ would be the the
webserver user’s home, while irb’s home would be your normal user’s