I am running my Rails app on the Ubuntu server. The structure of files on the disk is this:
/home /dokku/my-rails-app /text-files/txt/my-file.txt
In /home/dokku/my-rails-app
is my Rails app and I would like to open in this app the /home/text-files/txt/my-file.txt
file.
In the view of my Rails app, I do this:
<%= File.read("/home/text-files/txt/my-file.txt") %>
and it generated error ActionView::Template::Error (No such file or directory @ rb_sysopen - /home/text-files/txt/my-file.txt):
However, if I do the same approach in my development environment (OSX), it works and the file is properly displayed.
I also double-checked the path to the file on Ubuntu is correct and it is - if I SSH to terminal and run cat /home/text-files/txt/my-file.txt
, I get the file's content.
Am I overlooking something what prevents the Rails app display the content of the file?