I have application which is deployed to Heroku. I have added functionality for uploading users thorough the CSV. For this I have provided CSV upload functionality (Used Paperclip gem).
Here is my code for reading the file and creating new user
def import(file)
CSV.foreach(file.path, headers: true) do |row|
row_hash = row.to_hash.values
data = row_hash[0].split("\t")
.
.
.
end
On the local it is working fine. But on the heroku it is giving me following error
Errno::ENOENT: No such file or directory @ rb_sysopen - http://ift.tt/1Rcp67D
I referred following links Errno::ENOENT (No such file or directory) in amazon-s3
File reading from Amazon server, ruby on rails, no match route
but didn't any success. For more debugging, I tried same url from my local rails console and it is giving me the same error.
2.2.2 :008 > cp = "http://ift.tt/1Rcp67D"
2.2.2 :008 > f = File.open(cp, "r")
Errno::ENOENT: No such file or directory @ rb_sysopen - http://ift.tt/PsQMbo
Also tried open uri http://ift.tt/1knxXTX.
I can download the same file from the browser.
Can any one let me know how to resolve this error. Is there any bucket permission issue (I have already provided open access for the bucket).
Aucun commentaire:
Enregistrer un commentaire