# Rails 3 version of ActiveRecord usable with Rails 2?

**URL:** <https://www.ruby-forum.com/t/rails-3-version-of-activerecord-usable-with-rails-2/183652>\
**Category:** Rails\
**Created:** [February 18, 2010, 6:24am UTC](https://www.ruby-forum.com/t/rails-3-version-of-activerecord-usable-with-rails-2/183652 "2010-02-18T06:24:58Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 18, 2010, 6:24am UTC](https://www.ruby-forum.com/t/rails-3-version-of-activerecord-usable-with-rails-2/183652/1 "2010-02-18T06:24:58Z")

</div>

Anybody know if the changes coming to Rails 3 that affect ActiveRecord  
can be applied to Rails 2.x projects as well? If it’s just the  
ActiveRecord gem that’s changing, then we should be able to use the  
new ActiveRecord gem with Rails 2 apps, right?

(I ask because I’ve had trouble trying it out myself; installing the  
Rails 3 beta gems somehow hosed my ability to create rails 2.x apps,  
so until I straighten that out, I’m hoping someone might have seen  
some news/insight that I haven’t come across yet.)

Thanks!  
Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 18, 2010, 11:32am UTC](https://www.ruby-forum.com/t/rails-3-version-of-activerecord-usable-with-rails-2/183652/2 "2010-02-18T11:32:47Z")

</div>

On Wed, Feb 17, 2010 at 9:23 PM, Jeff [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Anybody know if the changes coming to Rails 3 that affect ActiveRecord  
> can be applied to Rails 2.x projects as well? If it’s just the  
> ActiveRecord gem that’s changing, then we should be able to use the  
> new ActiveRecord gem with Rails 2 apps, right?

No, this isn’t possible. Why? ActiveRecord in Rails 3 is dependent on  
other Rails 3.0 gems. For example, AR in Rails 3 depends on the  
following gems:

[http://gemcutter.org/gems/activerecord/versions/3.0.0.beta](http://gemcutter.org/gems/activerecord/versions/3.0.0.beta)

As an exercise for yourself, you can use the above to navigate the  
entire  
dependency graph and it should be clear why your approach wouldn’t be a  
good idea. Furthermore, you can compare the dependency graph for both  
Rails 2.3.5 and Rails 3.0.0 beta:

[http://gemcutter.org/gems/rails/versions/2.3.5](http://gemcutter.org/gems/rails/versions/2.3.5)  
[http://gemcutter.org/gems/rails/versions/3.0.0.beta](http://gemcutter.org/gems/rails/versions/3.0.0.beta)

> (I ask because I’ve had trouble trying it out myself; installing the  
> Rails 3 beta gems somehow hosed my ability to create rails 2.x apps,  
> so until I straighten that out, I’m hoping someone might have seen  
> some news/insight that I haven’t come across yet.)

Please post your issue(s) here with sufficient detail and the community  
will attempt to assist you.

-Conrad

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 19, 2010, 2:38am UTC](https://www.ruby-forum.com/t/rails-3-version-of-activerecord-usable-with-rails-2/183652/3 "2010-02-19T02:38:23Z")

</div>

On Feb 18, 4:31 am, Conrad T. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> [RubyGems.org | your community gem host](http://gemcutter.org/gems/activerecord/versions/3.0.0.beta)
> 
> As an exercise for yourself, you can use the above to navigate the entire  
> dependency graph and it should be clear why your approach wouldn’t be a  
> good idea. Furthermore, you can compare the dependency graph for both  
> Rails 2.3.5 and Rails 3.0.0 beta:
> 
> [RubyGems.org | your community gem host](http://gemcutter.org/gems/rails/versions/2.3.5)  
> [http://gemcutter.org/gems/rails/versions/3.0.0.beta](http://gemcutter.org/gems/rails/versions/3.0.0.beta)

Interesting, thanks for the links. ActiveRecord 3.0 depends on Arel,  
ActiveModel, and ActiveSupport. The only common dependency I see is  
ActiveSupport. If I could get a Rails 2.3.5 app to bind to  
ActiveSupport “\>= 2.3.5”, instead of exactly equal to 2.3.5, then  
perhaps it might work. Except, that I don’t know if there are  
breaking changes in ActiveSupport 3.0 that break Rails 2.3.5 apps  
(there probably are).

I guess I just wish the new ActiveRecord/ActiveSupport functionality  
could have been added to Rails 2.x, and we could have a new version  
like Rails 2.4, rather than only being available with Rails 3.0.

Thanks again,  
Jeff

---

<div class="post-metadata">

**Author:** ![jeff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/e19b73/32.png) [@jeff](https://www.ruby-forum.com/u/jeff)\
**Post date:** [February 19, 2010, 3:18am UTC](https://www.ruby-forum.com/t/rails-3-version-of-activerecord-usable-with-rails-2/183652/4 "2010-02-19T03:18:47Z")

</div>

On Thu, Feb 18, 2010 at 5:36 PM, Jeff [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> > 
> 
> Interesting, thanks for the links. ActiveRecord 3.0 depends on Arel,  
> ActiveModel, and ActiveSupport. The only common dependency I see is  
> ActiveSupport. If I could get a Rails 2.3.5 app to bind to  
> ActiveSupport “\>= 2.3.5”, instead of exactly equal to 2.3.5, then  
> perhaps it might work. Except, that I don’t know if there are  
> breaking changes in ActiveSupport 3.0 that break Rails 2.3.5 apps  
> (there probably are).

You need to look at all the dependencies for Rails 2.3.5 requires these  
exact dependencies:

Runtime Dependencies

1. _activeresource_ = 2.3.5  
[http://gemcutter.org/gems/activeresource](http://gemcutter.org/gems/activeresource)
2. _actionmailer_ = 2.3.5 [http://gemcutter.org/gems/actionmailer](http://gemcutter.org/gems/actionmailer)
3. _actionpack_ = 2.3.5 [http://gemcutter.org/gems/actionpack](http://gemcutter.org/gems/actionpack)
4. _activerecord_ = 2.3.5 [http://gemcutter.org/gems/activerecord](http://gemcutter.org/gems/activerecord)
5. _activesupport_ = 2.3.5 [http://gemcutter.org/gems/activesupport](http://gemcutter.org/gems/activesupport)
6. _rake_ \>= 0.8.3 [http://gemcutter.org/gems/rake](http://gemcutter.org/gems/rake)

Rails 2.3.5 requires ActiveSupport 2.3.5 (i.e. you cannot use an earlier  
version or a later version) of this gem. Next, the rake and bundler  
gems  
are compatible with both versions of Rails.

> I guess I just wish the new ActiveRecord/ActiveSupport functionality  
> could have been added to Rails 2.x, and we could have a new version  
> like Rails 2.4, rather than only being available with Rails 3.0.

Please understand that the Rails core team have re-architected many of  
the  
common components. Thus, you’ll need to upgrade to benefit from these  
changes and I would highly recommend reading the following as well as  
the  
associated links:

> **[rails.info](http://guides.rails.info/3_0_release_notes.html)**
>
> Ruby on Rails,Rails Tutorial,Ruby Basics,Rails 4,Bar Rails,Rail

> **[rails.info](http://guides.rails.info)**
>
> Ruby on Rails,Rails Tutorial,Ruby Basics,Rails 4,Bar Rails,Rail

Good luck,

-Conrad
