So I found out per this question that when you run:
rails server -d
Rails decides that its Dir.pwd
is /
. So when trying to read a file on the system, I need to execute with full path of said file (File.read("#{Rails.root}/path/to/file"
). How can I tell Rails to set Dir.pwd
to Rails.root
答案 0 :(得分:1)
单独使用rails s -d
无法解决这个问题。结束Phusion Passenger:passenger start -d
解决了我的问题