samedi 27 juin 2015

root path issues when server is run as a daemon

i have several views, as well as some gems, that access the filesystem. this seems to work fine until i run the server as a daemon. rails (4.2.3)

for example in one of my views I access the README file in the root of the app

File.read('README.md')

when running as a daemon, i get the error No such file or directory @ rb_sysopen - README.md

the error page shows the Rails.root path, which is correct. i CAN fix this problem by doing:

File.read("#{Rails.root}/README.md")

however this issue breaks more than just my views. It would seem an issue with the rails server.

Aucun commentaire:

Enregistrer un commentaire