I do not get this error when not running in daemon mode. I’ve googled a
bit but can’t find a reason. Does anyone have any ideas?
Also the reason I want to run in Daemon mode is because I have to host
my app on a uni virtual machine, and start the server after logging in
with ssh. When I close the ssh connection the server (if not running in
background) also seems to get killed.
Any ideas as to how I may be able to work around this?
When running my app in development with WEBrick in daemon mode I get the
following error when trying to upload a file:
Errno::ENOENT in UploadController#create
No such file or directory - public/data/upload/google
I do not get this error when not running in daemon mode. I’ve googled a bit
but can’t find a reason. Does anyone have any ideas?
My guess would be that ‘current working directory’ doesn’t mean the
same thing to a daemonized process; how are you specifying the target
directory? Regardless…
Also the reason I want to run in Daemon mode is …
Why Webrick? It’s only intended for desktop development work; you
would be better off using e.g. unicorn (my preference) or passenger
in a production environment.
I personally use mongrels for my development chops, and passenger in
production environments; I have yet to take the unicorn for a ride. I
advise
you to drop WEBrick entirely. Also, be sure to look at this security
considerations http://guides.rubyonrails.org/security.html#file-uploads if
you haven’t yet done so. Security always bears reminding…
Hi,
I solved this by including the absolute path to the directory where the
uploaded files are placed. Now the code is:
#takes the upload object and extracts the file.
def filesave #Calls the .original_filename method on the upload object and stores in
the variable name
name = upload.original_filename
directory = “/home/resource_portal/website/public/data/upload”
…
This works with WEBrick, but am now using thin.
Hope this helps anyone else experiencing the same problem.
Cheers,
Jen!
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.