I am trying to write a file via shell command in Rails..
Basically I have this:
def self.collect_videos
%x[cd public/videos/ && exec viddl-rb http://www.youtube.com/watch?v=oHg5SJYRHA0]
sleep(30)
end
viddl is essentially this: https://github.com/rb2k/viddl-rb
It works fine just from rails console, but not when called as a function from Rails app..
How to fix it?
The question was answered thanks to Mattias Wadman. Could not mark comment as answer though.