Rails 2 being dropped?

31 views
Skip to first unread message

Kevin Menard

unread,
Sep 27, 2010, 7:08:59 AM9/27/10
to carrierwave
Hi,

I'm running a fairly old version of carrierwave (0.4.5) and was
looking to upgrade. The recent History entries suggest that from 0.5,
Rails 2 support is being dropped in favor of Rails 3. Is this
accurate?

Thanks,
Kevin

Jonas Nicklas

unread,
Sep 27, 2010, 9:59:20 AM9/27/10
to carri...@googlegroups.com
Yes, that's accurate.

If you intend to keep running on Rails 2, I recommend adding a version
requirement like '~> 0.4.5'. That will get you the latest point
releases in the 0.4.X branch, which will continue to be Rails2
compatible.

/Jonas

> --
> You received this message because you are subscribed to the Google Groups "carrierwave" group.
> To post to this group, send email to carri...@googlegroups.com.
> To unsubscribe from this group, send email to carrierwave...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/carrierwave?hl=en.
>
>

Kevin Menard

unread,
Sep 29, 2010, 7:35:34 PM9/29/10
to carrierwave
It's unfortunate that all your existing users are going to get left
behind, but thanks for clarifying. It might help to update the README
with the information you've provided below. It wasn't until I started
digging into the source that I discovered why the latest gem wasn't
working for me.

--
Kevin

Jonas Nicklas

unread,
Oct 1, 2010, 10:04:27 AM10/1/10
to carri...@googlegroups.com
I've added a not about this to the README. Sorry for the inconvenience.

I do not see it like users getting left behind. CarrierWave 0.4 works
very well, and continuing to use it for Rails 2 applications isn't a
problem. Maintaining compatibility with both would be pretty annoying
for various reasons, which is why I chose to scrap Rails 2 support. If
you want the latest shiny toys, you're gonna have to upgrade, which
you probably should be doing anyway.

/Jonas

Kevin Menard

unread,
Oct 1, 2010, 10:51:28 AM10/1/10
to carri...@googlegroups.com
Thanks for the update. I'm just concerned about bug fixes, which I
assume aren't going to be backported, mostly because of the move to
fog. If I'm mistaken, please let me know. But, 0.4.5 -> 0.4.6 ->
0.5.0 changed the underlying S3 library in each release, so it's not
really clear which one is supposed to be "stable."

As for upgrading to Rails 3, I have a wide range of very rational
reasons why upgrading just wouldn't be prudent. It'd be considerably
easier to just maintain a fork of carrierwave with Rails 2
compatibility if need be.

Anyway, thanks again for the info and status update.

--
Kevin

Jonas Nicklas

unread,
Oct 1, 2010, 10:54:29 AM10/1/10
to carri...@googlegroups.com
There is a branch which is Rails 2 compatible called 0.4-stable, if
you want to make any changes there, please send me a pull request for
it.

/Jonas

Kevin Menard

unread,
Oct 1, 2010, 11:04:27 AM10/1/10
to carri...@googlegroups.com
Great! Thanks.

--
Kevin

Geoff Buesing

unread,
Oct 4, 2010, 11:51:22 AM10/4/10
to carrierwave
On Oct 1, 9:51 am, Kevin Menard <nirvd...@gmail.com> wrote:
> As for upgrading to Rails 3, I have a wide range of very rational
> reasons why upgrading just wouldn't be prudent.  It'd be considerably
> easier to just maintain a fork of carrierwave with Rails 2
> compatibility if need be.

I'm currently running the latest Carrierwave with Rails 2.3 by
bundling Carrierwave as a plugin (thus working around the gem
dependency for ActiveSupport 3.0), and backporting the few pieces of
ActiveSupport 3.0 that are required.

I've bundled the backports as a plugin:

http://github.com/gbuesing/carrierwave_rails23_compat

Trevor Turk

unread,
Oct 15, 2010, 6:13:36 AM10/15/10
to carrierwave
On Oct 4, 4:51 pm, Geoff Buesing <gbues...@gmail.com> wrote:
> I've bundled the backports as a plugin:
>
> http://github.com/gbuesing/carrierwave_rails23_compat

Thanks, g!

If you think it's possible/worthwhile to try and get these shenanigans
into carrierwave itself, please do holler. In any case, I'll add a
mention of this to the readme -- it might help some people out going
forward.

Geoff Buesing

unread,
Oct 15, 2010, 3:28:25 PM10/15/10
to carrierwave
Hello TT!

It wouldn't be too much work to get rid of the ActiveSupport/
ActiveModel dependencies altogether, which would allow CarrierWave to
be bundled as a gem with with any Rails version, and play well with
any existing version of ActiveSupport. We'd just need to bundle the
following in CarrierWave:

1. ActiveSupport::Concern (namespaced as CarrierWave::Concern)
2. ActiveModel::Validator (namespaced as CarrierWave::Validator)
3. Object#blank?, Module#anonymous? and Class inheritable attributes
core extensions (with respond_to? checks so that we don't overwrite
Rails' versions)

Also, in the initialization, we'd want to wrap the Rails::Railtie
definition in an if defined?(Rails::Railtie) block (b/c no
Rails::Railtie in Rails 2.3.)

Wouldn't be too much work -- I'd be glad to make the patches, if
there's interest.

I do like the idea of leveraging the "pluckable" architecture of
ActiveSupport 3.0, but with so many dependencies on pre-3.0 versions
of AS still out in the wild, it may make sense to bundle the few
required AS pieces in CarrierWave for now, so that everyone can
benefit from the bugfixes and new features in the 0.5 branch, without
hacks/workarounds (like my plugin.)

Jonas Nicklas

unread,
Oct 22, 2010, 10:27:48 AM10/22/10
to carri...@googlegroups.com
Hey Goeff,

how about making this a self-contained part of the CarrierWave repo, as in:

require 'carrierwave/rails2'

we can then have this in its own folder, where it doesn't affect the
rest of the gem at all. That might give us the best of both worlds.

/Jonas

Geoff Buesing

unread,
Oct 22, 2010, 6:55:19 PM10/22/10
to carrierwave
Not a bad idea -- I pulled this together in my repo:

http://github.com/gbuesing/carrierwave/tree/rails23

I included an init.rb so that CW can be vendored as a plugin, which
includes a check for Rails versions < 3, and loads additional support
(bundled in a folder under compatibility) as appropriate. Shouldn't
affect the rest of the gem at all.

Two caveats (Rails 2.3 only):
1. I'm not using ActiveRecord, so I can't test the ORM support. If
someone is motivated to get this working, it might not be too much
effort.
2. Generators aren't being auto-included in script/generate, so I
haven't bothered to check if those work. Probably not worth the effort
to make these work.

Trevor Turk

unread,
Nov 29, 2010, 5:34:42 AM11/29/10
to carrierwave
On Oct 22, 10:55 pm, Geoff Buesing <gbues...@gmail.com> wrote:
> Two caveats (Rails 2.3 only):
> 1. I'm not using ActiveRecord, so I can't test the ORM support. If
> someone is motivated to get this working, it might not be too much
> effort.
> 2. Generators aren't being auto-included in script/generate, so I
> haven't bothered to check if those work. Probably not worth the effort
> to make these work.

Sorry, I'm just seeing this. If these are the only two caveats, that's
seems fine. I can look into the AR ORM support. Would you mind opening
a pull request and then it'll be in the queue for me to look at?

Thanks!
- Trevor

P.S. Hope all is well in Chicago. London is colder than I'd hoped. I'm
escaping to Italy shortly, though :)
Reply all
Reply to author
Forward
0 new messages