-
Notifications
You must be signed in to change notification settings - Fork 337
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
attachment_fu + ruby 1.9.1 #25
Comments
Judging by the error message, something is nil that shouldn't be. Looks like the behavior of Tempfiles changed. Send me a pull request if you find a fix that works on ruby 1.8 and 1.9. Thanks! |
In attachment_fu/init.rb, in method make_tmpname second argument n is nil in ruby 1.9 when I upload file but don't know why: def make_tmpname(basename, n) |
was wondering if anyone has a solution to the problem? this happens on Ruby 1.9/Rails 3.0 |
adding n ||= 0 before calling sprintf (in attachment_fu/init.rb) seems to solve the problem. I can't say if this is a "valid" fix in terms of whether it breaks something, or whether it is working in ruby 1.8.7. |
thanx, @ivanpoznyak. works for me. |
I've tried both fixes I've found for this issue: and in both cases the crashing stops but something happens with my thumbnails.. they all get the same size as the original picture. Not sure if this is repeatable by others or if has something to do with my particular setup. Investigating further ... |
Another simple solution that seems to work well: sprintf('%s%d-%d%s', File::basename(basename, ext), $$, n.to_i, ext) Notice the: n.to_i At: http://marsorange.com/archives/of-mogrify-ruby-tempfile-dynamic-class-definitions |
Did anyone get thumbnails to work after implementing the fix for this issue? I think attachment_fu is attachment_fubar on ruby 1.9 :( |
Johnypez, I upgraded my app to Ruby 1.9.2 and had to make the fix mentioned above. I was then able to upload images but they weren't being resized nor where the thumbnails being created. I realized that the processor wasn't able to load ImageMagick. After uninstalling and reinstalling rmagick I then had a seg fault and had to also reinstall ImageMagick based on http://stackoverflow.com/questions/2838307/why-is-this-rmagick-call-generating-a-segmentation-fault. Once ImageMagick was up and running fine attachment fu properly resized the images and created thumbnails under 1.9.2. |
Something goes wrong when I upload:
/!\ FAILSAFE /!\ 2010-09-03 15:21:19 +0200
Status: 500 Internal Server Error
can't convert nil into Integer
/files/sources/rails/customer-service/vendor/plugins/attachment_fu/init.rb:7:in
sprintf' /files/sources/rails/customer-service/vendor/plugins/attachment_fu/init.rb:7:in
make_tmpname'/usr/lib64/ruby/1.9.1/tmpdir.rb:132:in
create' /usr/lib64/ruby/1.9.1/tempfile.rb:134:in
initialize'/usr/lib64/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/utils.rb:486:in
new' /usr/lib64/ruby/gems/1.9.1/gems/rack-1.1.0/lib/rack/utils.rb:486:in
block in parse_multipart'[...]
On ruby 1.8 is ok.
The text was updated successfully, but these errors were encountered: