dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-25 23:33 UTC
Using system() to execute a script outside of Rails but in a directory in the Rails app...
I''m trying to hack around a previously mentioned RMagick problem, confirmed to exist inside of Rails but not outside. Thus, I''d like to call a Ruby script from with in a Rails controller. Like so: system("#{RAILS_ROOT}/public/images/thumb_and_comp.rb", "#{@asset.file_name}") But it never seems to get executed. Permissions are set to 755 on the script. Any suggestion? --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
s.ross
2007-Jul-26 00:38 UTC
Re: Using system() to execute a script outside of Rails but in a directory in the Rails app...
If you''re just trying to do thumbnails, better to look at how file_column or a similar plugin accomplish that than to shell out to a different process. Rails is a one-in-one-out pipe, so blocking requests on a shell process could really screw up your performance. On Jul 25, 2007, at 4:33 PM, dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > I''m trying to hack around a previously mentioned RMagick problem, > confirmed to exist inside of Rails but not outside. > Thus, I''d like to call a Ruby script from with in a Rails controller. > Like so: > system("#{RAILS_ROOT}/public/images/thumb_and_comp.rb", > "#{@asset.file_name}") > > But it never seems to get executed. > Permissions are set to 755 on the script. > Any suggestion? > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jul-26 02:03 UTC
Re: Using system() to execute a script outside of Rails but in a directory in the Rails app...
I know Rails is a single threaded process, because Ruby is as well. But at this point even the maintainer of RMagick (who I''ve been talking to a lot the last few days) is mystified by how my thumbs can be correct when run from a straight Ruby script on the same system, but through Rails it gets screwed up. --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
s.ross
2007-Jul-26 04:14 UTC
Re: Using system() to execute a script outside of Rails but in a directory in the Rails app...
Well, I dunno, but I used file_column on one of my sites that''s been happily purring away and the relevant code is: img = ::Magick::Image::read(absolute_path).first resize_image(img, version_options[:geometry], absolute_path(name)) Where version_options[:geometry] is, as you might expect, the geometry to resize to a thumbnail. Are you doing something different? On Jul 25, 2007, at 7:03 PM, dangerwillrobinsondanger-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote:> > I know Rails is a single threaded process, because Ruby is as well. > But at this point even the maintainer of RMagick (who I''ve been > talking to a lot the last few days) is mystified by how my thumbs can > be correct when run from a straight Ruby script on the same system, > but through Rails it gets screwed up. > > > > > >--~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---