# Rcov and i18n gem

**URL:** <https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695>\
**Category:** Rails I18n\
**Created:** [February 18, 2010, 8:09pm UTC](https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695 "2010-02-18T20:09:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@felipe](https://www.ruby-forum.com/u/felipe)\
**Post date:** [February 18, 2010, 8:09pm UTC](https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695/1 "2010-02-18T20:09:09Z")

</div>

Hi guys,

I installed rails 3 beta, and the gem i18n (active\_support  
dependency).

After this, when I migrated my app to rails 2.3.5, it was 2.3.2, it  
became to raise an error when I ran rcov reports.

The error is:  
/usr/lib/ruby/gems/1.8/gems/i18n-0.3.3/lib/i18n/core\_ext/string/  
interpolate.rb:88:in `%': one hash required (ArgumentError) from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/formatters/ text_report.rb:21:in`print\_info’  
from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/formatters/  
text\_report.rb:10:in `execute' from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/formatters/ base_formatter.rb:65:in`each’  
from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/formatters/  
base\_formatter.rb:65:in `each_file_pair_sorted' from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/formatters/ text_report.rb:8:in`execute’  
from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/  
code\_coverage\_analyzer.rb:146:in `dump_coverage_info' from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/ code_coverage_analyzer.rb:146:in`each’  
from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/lib/rcov/  
code\_coverage\_analyzer.rb:146:in `dump\_coverage\_info’  
from /usr/lib/ruby/gems/1.8/gems/rcov-0.9.6/bin/rcov:428  
from /usr/lib/ruby/1.8/test/unit.rb:278

I updated rcov to 0.9.7.1 but the error remains the same.

Then I removed i18n gem and everything came back to normal again.

We will be migrating to rails 3 soon, so how I can solve this?

Felipe

---

<div class="post-metadata">

**Author:** ![felipe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@felipe](https://www.ruby-forum.com/u/felipe)\
**Post date:** [February 23, 2010, 12:04am UTC](https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695/2 "2010-02-23T00:04:41Z")

</div>

I got the same problem

> **[Issues · stffn/declarative\_authorization](https://github.com/stffn/declarative_authorization/issues/#issue/30)**
>
> An unmaintained authorization plugin for Rails. Please fork to support current versions of Rails - Issues · stffn/declarative\_authorization

any suggestion of which is the correct thing to do ?

Regards,  
rodrigob.

---

<div class="post-metadata">

**Author:** ![felipe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@felipe](https://www.ruby-forum.com/u/felipe)\
**Post date:** [February 25, 2010, 2:58pm UTC](https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695/3 "2010-02-25T14:58:18Z")

</div>

This should be resolved in in

> <https://github.com/ruby-i18n/i18n/commit/bd740600683ca2aae78e4abf898f011627b623e0>

which is contained in I18n 0.3.4 and available on Gemcutter.

This was also reported on  
[Issues · ruby-i18n/i18n · GitHub](http://github.com/svenfuchs/i18n/issues/closed#issue/9) and  
[#20 i18n fails interpolation with %% in strings (ArgumentError: one hash required) - Ruby I18n - i18n](http://i18n.lighthouseapp.com/projects/14947-ruby-i18n/tickets/20)

Thanks everybody!

---

<div class="post-metadata">

**Author:** ![felipe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@felipe](https://www.ruby-forum.com/u/felipe)\
**Post date:** [February 25, 2010, 9:17pm UTC](https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695/4 "2010-02-25T21:17:39Z")

</div>

Funny, I just ran into this today and ticketed it in Rails:  
[https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4052](https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4052)

Sven, maybe you could explain just how the i18n gem and the built-in  
Active Support core ext are meant to interact? As that ticket states,  
when I ran the Active Support tests, it used the method from my i18n  
gem.

---

<div class="post-metadata">

**Author:** ![felipe](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/f/90db22/32.png) [@felipe](https://www.ruby-forum.com/u/felipe)\
**Post date:** [February 25, 2010, 9:39pm UTC](https://www.ruby-forum.com/t/rcov-and-i18n-gem/183695/5 "2010-02-25T21:39:18Z")

</div>

Hey Henrik,

On Feb 25, 2010, at 9:16 PM, Henrik N. wrote:

> Funny, I just ran into this today and ticketed it in Rails:  
> [#4052 ActiveSupport breaks literal "%%" in non-hash String interpolation - Ruby on Rails - rails](https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4052)

Oops 🙂

Yeah, I that problem should go away with upgrading the I18n gem?

> Sven, maybe you could explain just how the i18n gem and the built-in  
> Active Support core ext are meant to interact? As that ticket states,  
> when I ran the Active Support tests, it used the method from my i18n  
> gem.

basically Rails shipped the I18n gem as a vendored gem from 2.2.0 (which  
introduced I18n support in Rails) until 3.0.0 (which stops shipping any  
dependencies as vendored code, afaik).

ActiveSupport is not the only library in Rails that vendored stuff but  
here’s where these gems were located:

> **[rails/activesupport/lib/active\_support/vendor at v2.3.0 · rails/rails](https://github.com/rails/rails/tree/v2.3.0/activesupport/lib/active_support/vendor)**
>
> v2.3.0/activesupport/lib/active\_support/vendor

At first users were forced to use the vendored gem no matter which gem  
version had been released and installed on the user’s system in the  
meanwhile:

[rails/activesupport/lib/active\_support/vendor.rb at v2.3.0 · rails/rails · GitHub](http://github.com/rails/rails/blob/v2.3.0/activesupport/lib/active_support/vendor.rb#L27)

Starting from 2.3.3.1 users could install the gem locally and  
ActiveSupport would prefer that one over the vendored/shipped version,  
but ONLY if the version is I18n \>= 0.1.3 and \<= 0.2.0 (that’s what that  
‘~\> 0.1.3’ expression says):

[rails/activesupport/lib/active\_support/vendor.rb at v2.3.3.1 · rails/rails · GitHub](http://github.com/rails/rails/blob/v2.3.3.1/activesupport/lib/active_support/vendor.rb#L24)

In Rails 2.3.5 this was relaxed so that the user could install any I18n  
version \>= 0.1.3 and ActiveSupport would pick it up:

[rails/activesupport/lib/active\_support/vendor.rb at v2.3.5 · rails/rails · GitHub](http://github.com/rails/rails/blob/v2.3.5/activesupport/lib/active_support/vendor.rb#L24)

Starting from Rails 3 afaik Bundler will install and use whatever  
version you tell it through the Gemfile. I haven’t really looked closely  
at that though.
