Use Pathname#to_s instead of Pathname#to_path

Should fix #1723. Works locally on v1.8.7-p371