I am looking a read an mp3 file currently located in my public folder.
I have tried the following:
2.5.3 :016 > audio_file = File.new('/demo.mp3', 'rb')
And it resulted with the following error:
Traceback (most recent call last): 3: from (irb):16 2: from (irb):16:in `new' 1: from (irb):16:in `initialize' Errno::ENOENT (No such file or directory @ rb_sysopen - /demo.mp3)
I would assume this is pretty straight forward but for some reason it does not work. Does anybody knows how to do that ?
Alternatively, would it be possible to read a file that is located in a server via an
http://xxxxxxx.xxxxx/xxxx/mp3 for example ? (This is where the file is located initially).