Rails 2.3.12 & 2.3.14 : invalid gem_dependency #2818

wants to merge 861 commits into


None yet

Coren commented Sep 2, 2011


Puppet dashboard reveal a problem with Ruby On Rails 2.3.X with a gem_dependency call. It's not compatible with the rubygem packaged version of Ubuntu Lucid Lynx LTS. It throws this error message :
gem_dependency.rb:81 "undefined method `requirement' for #Rails::GemDependency:0x7f8dbb42dad8"

You can have more information on this issue :

I have already made a patch which seems to fix the problem :

Would you please apply it in the next version of Rails 2.3.X ?


amatsuda and others added some commits Jul 1, 2009

Expect an incompatible encoding exception when a template doesn't hav…
…e a magic comment and its source encoding doesn't match the default external encoding
Expect an incompatible encoding exception when a template with a magi…
…c comment renders a partial without one and its source encoding doesn't match the default external encoding
actionpack: added missing encoding comments [#4466 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Add ActiveResource::Base.include_root_in_json, like Active Record, to…
… serialize instances as hash of model name -> attributes hash rather than the bare attributes hash. [#2584 state:committed]

Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Destroy respects optimistic locking.
Now works with :dependent => :destroy and includes unit tests for that
case.  Also includes better error messages when updating/deleting stale

[#1966 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
making rake:migrate VERSION=0 a noop called in succession. [#2137 sta…

Signed-off-by: José Valim <jose.valim@gmail.com>
repair the activesupport message encryptor tests for me, do so in the…
… same way as jeremy did with message verifier

[#4517 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Allow pre-casted values (other than nil) to pass through from calcula…
…tions un-touched

[#4514 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
AR JSON Serializer now supports custom root option.
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Use primary key in conditions, not 'id' [#4395 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>


add support for mysql2 adapter to dbconsole
[#4532 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
simple_format should return html_safe but not escape text, that's for…
… rails_xss plugin [#3767 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Make find_or_create and find_or_initialize work mixing explicit param…
…eters and a hash. ht: Marc-André Lafortune

[#4457 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>

Do you mean to do this? You're assigning the same object to two separate variables, and then merging them later on 1955 (when they're going to be the same?) Perhaps you mean to define these variables both as empty hashes? Is there something I'm missing?


spastorino replied May 8, 2010

Ryan, you're right in part. I didn't mean to do this but this works well because of the line 1949.
if line 1949 is executed the hashes are not the same anymore.
But if args hasn't a hash they will be the same as you said but the functionality don't fail. Why? because i merge the same hash so nothing happends and i execute attributes= twice for unprotected_attributes so it's ok.
Anyways is not the intended solution and of couse is best to do a separate assignment, i will fix this later.

eparreno and others added some commits May 8, 2010

Add index length support for MySQL [#1852 state:resolved]

  add_index(:accounts, :name, :name => 'by_name', :length => 10)
  => CREATE INDEX by_name ON accounts(name(10))

  add_index(:accounts, [:name, :surname], :name => 'by_name_surname', :length => {:name => 10, :surname => 15})
  => CREATE INDEX by_name_surname ON accounts(name(10), surname(15))

Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Revert "Revert "Add index length support for MySQL [#1852 state:resol…
…ved]" (breaks the build)"

This reverts commit eababa3.
type_cast_calculated_value refactor: value is never a Fixnum here. Fi…
…x test since SQLite returns Float.

[#4514 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
to_json and to_xml tests added to ActiveResource
[#4529 state:resolved]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
backported AR correction to find_each and find_in_batches to raise wh…
…en the user uses select but does not specify the primary key

Signed-off-by: José Valim <jose.valim@gmail.com>
partial counters with :as [#2804 state:resolved]
Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
db:drop:all throws error when database does not exist [#2997 state:re…

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
make sure `as` is set before trying to build an #{as}_counter. [#2804

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
docs + test for each_error
[#3185 state:committed]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
Don't carry default value when changing column for a binary type on M…
…ySQL [#3234 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
using :time_select when the attribute type is :time in the scaffold g…
…enerator. [#2377 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
Fix broken integration test in 2.x [#4565 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
make fixture accessors private
prevent to be run fixture accessor (e.g. test_foos for TestFoo model) as a test case

Signed-off-by: José Valim <jose.valim@gmail.com>
when we run rake rails:freeze:edge update the value of the "REVISION"…
… file rather than creating a new file "REVISION_ce706..." each time [#1694 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
Added assert_attribute_type to clean up GeneratedAttributeTest [#2377

Signed-off-by: José Valim <jose.valim@gmail.com>

This test is not sufficient, and allowed a bug to pop in.

Run this twice and you get a duplicate :
post.comments.find_or_create_by_body_and_type('3rd test comment body', 'test')
post.comments.find_or_create_by_body_and_type('3rd test comment body', 'test')
assert_equal 4, post.comments.count
assert_equal 4, post.comments.length

Actually your change broke the "find" part of the "find_or_create", as a new entry is created each time.

I had an error here because session is a Hash and doesn't have a destroy method. Seems consistent with the line below where session is initialized as a Hash. Shouldn't this case be checked ? (like if session.responds_to? :destroy, or something)

This change breaks 2.3.11 session expiration.
Rack accepts :expire option which supposed to be a Time

Fixed in this commit

What is the reason for systematically writing the cookie header when the expire_after option is set ?
This prevents proper http caching via expire headers.


mislav replied Apr 14, 2011

The server needs to constantly update the cookie when the expire_after option is set.

isc replied Apr 16, 2011

Ok, I thought this was only necessary when using the cookie store since the expiration of the data when using say the MemCacheStore is handled by memcached. But the cookie containing the session id needs to be updated if it has been set with an expiration date.
I got confused because in the 2.3.11 release the cookie header isn't set with an expiration date in the abstract store. I see that it has been fixed in trunk since then ( b0be721 ).
However in terms of http caching it's better to have a cookie header with a session scope and let the underlying store expire the data thus avoiding the systematic Set-Cookie header that prevents for instance the nginx proxy_cache directive to cache the answer.

gmarik and others added some commits Apr 4, 2011

respect :expire_after option
- it was broken after
- there's also

- also: maybe it worth making Rack understand :expire_after as we
duplicate same logic in [cookie_store](https://github.com/gmarik/rails/blob/v2.3.11/actionpack/lib/action_controller/session/cookie_store.rb#L114)

Signed-off-by: José Valim <jose.valim@gmail.com>
Fixing dynamic finders on associations to properly send arguments to …
…the find_by_* method. Closes issue #330.

Commit fdfc8e3 introduced a bugfix to prevent additional values passed
to a dynamic find_or_create_by_x methods from confusing the finder.
This patch also broke the essential behavior of this method on an
association by incorrectly sending arguments to the find_by_x methods.
The finder method would always see its inputs as a single array of
values instead of individual arguments, almost guaranteeing that the
finder call would be incorrect, and that we'd always create a new
record instead.

This patch adds a splat operator to the parameter array we send along to
the dynamic finder so that it receives its inputs correctly, and
includes an additional test to ensure that repeated calls to
find_or_create_by_x only creates one new record.
Merged pull request #331 from daphonz/2-3-stable.
Dynamic find_or_create_by_x_and_y always creates new records in Rails 2.3.11
Merged pull request #198 from robdimarco/2-3-stable.
Patch for issue 6440 - Session Reset undefined method `destroy' for {}:Hash

rdp commented on e8b84ab May 5, 2011

My concern is that it seems like every case...should probably have an "else throw 'unknown adapter'" clause to avoid silent failure "it does nothing and doesn't create the db" type thing.

zenspider and others added some commits May 12, 2011

Removed buggy GemDependency#requirement override. Overrides should NE…
…VER change the semantics of the parent (returning nil if default).
Fixed buggy gem activation. Don't pass a dependency to gem, pass the
name and requirement. Better, just activate the spec for the
dependency (1.8 only)
Removed the bulk of the deprecations by simply not calling refresh.
This may cause problems. I dunno.
The real solution is to get rid of all of this mess and use gem paths properly.
+ Switched to newer rdoc and gem package tasks (and their requires).
+ Fixed deprecated usage in gemspecs.

Bumped the version to 2.3.12 so I could test locally with actual
installs. If this is bad form for this project, please beat me up and
I'll split them out.

If Rails ~> 2.3.12 now depends on the rdoc gem, shouldn't that be declared in the gemspec?

kylev replied Jul 3, 2011

Seconded. I just got bit by this upgrading an app to 2.3.12. It's a shadow dependency that breaks functionality out of the box. Since it isn't required by core rails but only in the Rakefiles, I got away with "gem 'rdoc', :require => nil" in my Gemfile.

ippa commented on 8d02083 Jun 17, 2011


@Coren Coren closed this Sep 2, 2011

Doesn't this create a denial-of-service vulnerability? A rogue site can force you to log out, now.


fxn commented on 79aa54d Feb 15, 2013

Hi @zenspider, was you able to generate the API after this patch?

rake rdoc does not run with RDoc 2.3.0 because of the new code. With 2.4.2 you get a usage dump because of the error "invalid option: -A cattr_accessor=object", and with 2.5 you get "invalid option: --line-numbers" and an error message about the existence of the "doc" directory (albeit the destination "doc/rdoc" does not exist).

We need to be able to run "rake rdoc", and have doc/template/horo.rb used as template as always in 2.3.x.


zenspider replied Feb 15, 2013

New code? This commit is 2 years old. It must have worked then.


fxn replied Feb 15, 2013

Yeah, by "new code" I meant the new code introduced by this patch.

If I am not mistaken the API of 2-3-stable has not been regenerated in two years.


zenspider replied Feb 15, 2013

The changes I made were to deal with looong standing deprecations between rake's doco tasks switching to rdoc's doco tasks. Again. I'm pretty sure my changes worked then. rdoc 2.3.0 is dated 2009-01-28, so I don't know what you're asking of me at this point.

Maybe you should be using a newer rdoc install? And ensure that you're picking up the right rdoc task?


fxn replied Feb 15, 2013

Yeah, I tried all 2.x versions an none worked. I tried all 2.x versions with the previous Rakefiles and they didn't succeed either. It's been a while but I am almost certain that we depended on an old version of RDoc due to the jamis template.

I could generate the API reverting this and running the task with no gem installed, so that it picked the RDoc 1.0.1 distributed with 1.8.7.


fxn replied Feb 15, 2013

Yep, I am going to revert this patch except for the versions (so manual revert). Note this is 2-3-stable, recent branches are different.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment