Skip to content

update dm-paperclip for ruby 1.9.2 #22

Closed
wants to merge 6 commits into from

3 participants

@bunnymatic

hey there

just made a quick update to the dm-paperclip to support new sprintf in ruby 1.9.2 which seems to fail with nil conversions.


ruby-1.8.7> sprintf('%d',nil)
=> "0"

ruby-1.9.2> sprintf('%d',nil)
TypeError: can't convert nil into Integer
        from (irb):1:in `sprintf'n = nil

I looked at all the different forks and it seems like bundler is picking up your original branch. I tried a couple other forks (gix and solnic) that had more code dev but they had the same issue, so i thought i'd start at the base.

The fix is simple. The other mods i've done are just to generalize the tests so they worked on my system (make "require" statements use File.expand_path) and adding a Gemfile so i could build a bundle from which to run the tests.

bunnymatic and others added some commits Jun 28, 2011
@bunnymatic bunnymatic * update tests so they run (expand_path on inclusion of helper)
 * added Gemfile to get tests running
a32cc6d
@bunnymatic bunnymatic * convert n to n.to_i for Tempfile creation - ruby 1.9.2 sprintf doe…
…sn't make nil -> 0
bf7ffee
@bunnymatic bunnymatic Merge branch 'update-for-ruby-1.9.2' 450d6f3
@bunnymatic bunnymatic * updated gemspec 8af87f0
dineshraju Fixed typo c2b573e
@bunnymatic bunnymatic Merge pull request #1 from dineshraju/master
Yep.  

Not sure if you care, but this branch is already a fork of krobertson/dm-paperclip who started the project.  But he hasn't merged in my 1.9.2 fix.

Thanks for the fix.

Jon
82fa1c6
@krobertson
Owner

Pulling in a number of changes from another fork and they rewrote the make_tmpname method in a way that avoided this issue. Thanks for the pull req and sorry for the delays.

Have to update the validations for DM 1.2 and then will do a new release.

@krobertson krobertson closed this Apr 17, 2012
@bunnymatic

np. thanks for the info. i'm looking forward to the new version as it also will have the fix that i just ran into on heroku with NameError uninitialized constant Paperclip::Storage::S3::Merb.

@krobertson
Owner

I still haven't gotten to rewriting the validators, but will be soon.

@bunnymatic
@conraddecker

I'm seeing the "NameError uninitialized constant Paperclip::Storage::S3::Merb" as well. Was this ever fixed? Am I perhaps missing something obvious?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.