Paperclip on Rails 3 Beta

by James

Update: you should read this more recent article for an explanation of how to use Paperclip with the latest beta release of Rails 3.

I got Paperclip working on Rails 3 today. Here’s how.

First, I found (by accident) a branch in the Paperclip repository on Github called “Rails 3″. Call me crazy but I thought that might be worth a try.

Normally you’d install Rails 3 plugins using rails plugin install, but in this case I used git submodule:

These two commands checkout the rails3 branch of Paperclip into vendor/plugins/paperclip, as a Git submodule. If you don’t understand Git submodules, you can read about them here.

I also found that Paperclip wasn’t properly handling image styles; the ‘Paperclip’ section of this post explains how I fixed this (a word of warning: it’s a simple one-line edit which solved my problem but is untested with regard to the rest of Paperclip).

As always, feel free to post questions or feedback in the comments. Good luck!