I have a small perl script, used to watermark and personalized a pdf file for download. I have been unsuccessful in getting the script to execute. This is part of a function in the protectedfile model, maybe it has to be in the controller? output = `#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl #{self.filename} "#{user.fullname}" #{user.username}` any help? -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
if you''re trying to execute the file, than try the %x() sytax: output = %x("#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl #{self.filename} ''#{user.fullname}'' #{user.username}") ed On 12/12/06, gm <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote:> > I have a small perl script, used to watermark and personalized a pdf > file for download. I have been unsuccessful in getting the script to > execute. > > This is part of a function in the protectedfile model, maybe it has to > be in the controller? > > output = `#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl > #{self.filename} "#{user.fullname}" #{user.username}` > > any help? > > -- > Posted via http://www.ruby-forum.com/. > > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---
On 12/13/06, Ed Hickey <bassnode-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > if you''re trying to execute the file, than try the %x() sytax: > > output = %x("#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl > #{self.filename} ''#{user.fullname}'' #{user.username}") > > edIsn''t backtick and %x the same thing?> > > On 12/12/06, gm <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org> wrote: > > > > I have a small perl script, used to watermark and personalized a pdf > > file for download. I have been unsuccessful in getting the script to > > execute > > > > output = `#{RAILS_ROOT}/ProtectedFiles/bin/personalizePDF.pl > > #{self.filename} "#{user.fullname}" #{user.username}` > >How do you know that the script didn''t run? I would look for the obvious problems, like permissions. Can the user that is runing your rails app get to the file? What are the permissions on the directory? Does the file personalizePDF.pl have the execute bit set? etc. How about redirecting stderr to a file in /tmp and see if a) the file gets created and if there are problems with running it? Lots of investigation to be done. Bruce. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---