
Temp file problems with ruby-1.8.7-p22
Reported by Dave | July 21st, 2008 @ 05:04 PM
I've run into some problems with temp files using RMagick after updating Ruby to 1.8.7. The result is that attachment_fu is creating the thumbnail images, but they're the same size, resolution, and dimensions as the original - in other words, the image isn't getting processed. I get the following errors:
Parameters: {"parent_column"=>"photos", "eid"=>"d626ea68b4c2fa35657600c35289bf89", "commit"=>"Create", "nested"=>"true", "authenticity_token"=>"d12d8b5f53ef8cff0cdaf53098b4e82d6e1d82b1", "iframe"=>"true", "action"=>"create", "parent_model"=>"Album", "controller"=>"photos", "record"=>{"uploaded_data"=>#, "title"=>"hthrh"}}
User Columns (0.002188) SHOW FIELDS FROM `users`
User Load (0.001028) SELECT * FROM `users` WHERE (`users`.`id` = 1) LIMIT 1
SQL (0.000168) BEGIN
Album Columns (0.002150) SHOW FIELDS FROM `albums`
Album Load (0.001024) SELECT * FROM `albums` WHERE (`albums`.`id` = 8)
Exception working with image: unable to open image `/Uu/UuquWXO8FeGMQ6oSikrLR++++TI/-Tmp-/CGI453-1': No such file or directory
Exception working with image: unable to open image `/Uu/UuquWXO8FeGMQ6oSikrLR++++TI/-Tmp-/CGI453-1': No such file or directory
Photo Create (0.000343) INSERT INTO `photos` (`created_at`, `size`, `album_id`, `content_type`, `title`, `thumbnail`, `updated_at`, `filename`, `height`, `parent_id`, `width`) VALUES('2008-07-21 17:17:08', 30166, 8, 'image/jpeg', 'hthrh', NULL, '2008-07-21 17:17:08', 'austin_hwy.jpg', NULL, NULL, NULL)
Photo Load (0.002159) SELECT * FROM `photos` WHERE (`photos`.`thumbnail` = 'medium' AND `photos`.`parent_id` = 402) LIMIT 1
Exception working with image: unable to open image `/Uu/UuquWXO8FeGMQ6oSikrLR++++TI/-Tmp-/CGI453-1': No such file or directory
Photo Create (0.000230) INSERT INTO `photos` (`created_at`, `size`, `album_id`, `content_type`, `title`, `thumbnail`, `updated_at`, `filename`, `height`, `parent_id`, `width`) VALUES('2008-07-21 17:17:08', 30166, NULL, 'image/jpeg', NULL, 'medium', '2008-07-21 17:17:08', 'austin_hwy_medium.jpg', NULL, 402, NULL)
Photo Load (0.001971) SELECT * FROM `photos` WHERE (`photos`.`thumbnail` = 'title' AND `photos`.`parent_id` = 402) LIMIT 1
Exception working with image: unable to open image `/Uu/UuquWXO8FeGMQ6oSikrLR++++TI/-Tmp-/CGI453-1': No such file or directory
Photo Create (0.000207) INSERT INTO `photos` (`created_at`, `size`, `album_id`, `content_type`, `title`, `thumbnail`, `updated_at`, `filename`, `height`, `parent_id`, `width`) VALUES('2008-07-21 17:17:08', 30166, NULL, 'image/jpeg', NULL, 'title', '2008-07-21 17:17:08', 'austin_hwy_title.jpg', NULL, 402, NULL)
Photo Load (0.001965) SELECT * FROM `photos` WHERE (`photos`.`thumbnail` = 'preview' AND `photos`.`parent_id` = 402) LIMIT 1
Exception working with image: unable to open image `/Uu/UuquWXO8FeGMQ6oSikrLR++++TI/-Tmp-/CGI453-1': No such file or directory
Photo Create (0.000205) INSERT INTO `photos` (`created_at`, `size`, `album_id`, `content_type`, `title`, `thumbnail`, `updated_at`, `filename`, `height`, `parent_id`, `width`) VALUES('2008-07-21 17:17:08', 30166, NULL, 'image/jpeg', NULL, 'preview', '2008-07-21 17:17:08', 'austin_hwy_preview.jpg', NULL, 402, NULL)
Photo Load (0.001999) SELECT * FROM `photos` WHERE (`photos`.`thumbnail` = 'large' AND `photos`.`parent_id` = 402) LIMIT 1
Exception working with image: unable to open image `/Uu/UuquWXO8FeGMQ6oSikrLR++++TI/-Tmp-/CGI453-1': No such file or directory
Photo Create (0.000206) INSERT INTO `photos` (`created_at`, `size`, `album_id`, `content_type`, `title`, `thumbnail`, `updated_at`, `filename`, `height`, `parent_id`, `width`) VALUES('2008-07-21 17:17:08', 30166, NULL, 'image/jpeg', NULL, 'large', '2008-07-21 17:17:08', 'austin_hwy_large.jpg', NULL, 402, NULL)
SQL (0.000344) COMMIT
This prevents all of the image processing I do using RMagick, including a script that I use to render text on images. Any thoughts on this?
Thanks,
Dave Flaherty
Comments and changes to this ticket
-
boowebb July 26th, 2008 @ 01:55 PM
I narrowed at least one problem down to attachment_fu.rb line 70.
ruby has added String#starts_with? so it appears this line should change to:
attachment_options[:path_prefix] = attachment_options[:path_prefix][1..-1] if options[:path_prefix].starts_with?("/")
this change has gotten me around my upload problem with ruby 1.8.7. I am not using ImageMagick in my implementation.
-
Robert July 31st, 2008 @ 02:25 PM
This is because the latest ruby update is only compatible with rails 2.x
(They update have already broken many sites)
The fix is to roll back the ruby update or use Ruby Enterprise.
-
Robert July 31st, 2008 @ 02:28 PM
Heres the link with more info:
/www.rubyinside.com/june-2008-ruby-security-vulnerabilities-927.html
Please Sign in or create a free account to add a new ticket.
With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป