Hi there, since two days or so my application doesn''t seem to execute the system method. I use it for generating thumbnails like: def create_thumb(field,image_name) thumb_name = "..." path = "..." # call ImageMagick method from console command = "convert -thumbnail 120x120 " + path + image_name + " " + path + thumb_name logger.info("UPLOAD: before converting to 120x120 with #{command}") system(command) ..... end The output to the logger is correct. When I execute the command string in the console (rails console or linux console) it works. But it seems not to work inside my Rails controller, which is really weird. It just don''t gets executed. I don''t get any error messages, any. Where else can I look? Thanks for any help. Chris -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 1, 2:04 pm, Christoph Jasinski <christoph.jasin...-gM/Ye1E23mwN+BqQ9rBEUg@public.gmane.org> wrote:> > The output to the logger is correct. When I execute the command string in > the console (rails console or linux console) it works. But it seems not to > work inside my Rails controller, which is really weird. It just don''t gets > executed. I don''t get any error messages, any. Where else can I look?Have you looked at the return value of system and $? Fred -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Christoph Jasinski
2010-Feb-01 14:23 UTC
Re: Re: Problems with system("...") method in Rails
Thank Fred, didn''t know about that possibility. But unfortunately the result is 0. So it''s really bad magic to me. Am trying to set the command path manually. Maybe that works. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Christoph Jasinski
2010-Feb-01 14:49 UTC
Re: Re: Problems with system("...") method in Rails
Seems that I had to write the full path to convert. That might be cause by a problem I had with rmagick and had to install ImageMagick in two different ways (from source and from rpm) at the same time. It had screwed the path to convert. But somehow the rails console and linux console had no problem with the path, only a controller method. When I removed all the comments and the loggin'' calls I didn''t work again. So I left them. Somewhere along the ''path'' there must be a problem. When I solve that I gonna tell you. -- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
Frederick Cheung
2010-Feb-01 16:19 UTC
Re: Re: Problems with system("...") method in Rails
On 1 Feb 2010, at 14:49, Christoph Jasinski wrote:> Seems that I had to write the full path to convert. That might be cause by a problem I had with rmagick and had to install ImageMagick in two different ways (from source and from rpm) at the same time. It had screwed the path to convert. But somehow the rails console and linux console had no problem with the path, only a controller method. > When I removed all the comments and the loggin'' calls I didn''t work again. So I left them. Somewhere along the ''path'' there must be a problem. When I solve that I gonna tell you. >You could easily be running as a different user which could cause $PATH to have different values. Fred> -- > 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org > To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. > For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.-- 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-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.