Problem with Paperclip

561 views
Skip to first unread message

RanzQ

unread,
Mar 30, 2011, 6:49:08 AM3/30/11
to Hobo Users
Hi,

I followed this tutorial:

http://cookbook.hobocentral.net/plugins/paperclip_with_hobo

But when I try open the new-page of my model, I get this error:

Unable to generate hash without :hash_secret

It seems to be raised from the hash() method in Paperclip::Attachment.

What should I do to fix this?

Matt Jones

unread,
Mar 30, 2011, 11:37:46 AM3/30/11
to hobo...@googlegroups.com

Looks like you'll need to pass :hash_secret to the has_attached_file method in your model.

--Matt Jones

RanzQ

unread,
Mar 30, 2011, 4:48:44 PM3/30/11
to Hobo Users
Thanks for the answer, that probably would have fixed it, that seems
to be a key for the filepath hash.

I ended up using attachment_fu plugin which had some problems too with
the new ruby but I got it working finally.

Tim Griffin

unread,
May 5, 2011, 11:11:09 AM5/5/11
to Hobo Users

Just in case anyone is also dealing with this "hash_secret" issue
(with Hobo 1.3, Rails3), note that it is an open issue at Thoughtbot's
repo here:

https://github.com/thoughtbot/paperclip/issues/450

For anyone who needs an immediate patch, there is a forked version
here that deals with the hash_secret problem:

https://github.com/jeanmartin/paperclip.git

So, at a pinch, your Gemfile can reference this using:

gem 'paperclip', :git => "git://github.com/jeanmartin/
paperclip.git", :branch => "master"

As Bryan Larsen kindly pointed out, Paperclip versions up to 2.3.9
appear to have a dependency locked to activesupport v2.3.2. Paperclip
versions 2.3.10 and later allow activesupport v2.3.2 and later (and
are therefore okay for Rails 3).

Tim

Tim Griffin

unread,
May 5, 2011, 11:13:41 AM5/5/11
to hobo...@googlegroups.com
Just in case anyone is also dealing with this "hash_secret" issue (with Hobo 1.3, Rails3), note that it is an open issue at Thoughtbot's repo here:


For anyone who needs an immediate patch, there is a forked version here that deals with the hash_secret problem:


So, at a pinch, your Gemfile can reference this using:

gem 'paperclip', :git => "git://github.com/jeanmartin/paperclip.git", :branch => "master" 
Reply all
Reply to author
Forward
0 new messages