Revert some warning removals related to Ruby 2.0

These warnings were actually a bug in Ruby 2.0, the accessors should not
be raising such warnings, they are only meant for ivars.

-

Revert "fix warnings in Ruby 2.0"

This reverts commit 26702a6d3461f4a1c75165030b96886514ecb877.

-

Revert "Merge pull request #8282 from arunagw/warning_removed_for_ruby2"

This reverts commit f63d6544e45e78cda29c0c56fbdf3d9e1f405340, reversing
changes made to 3a890681fad8218305585036abed6d7463a44e41.