# Installation workaround for i18n gem 0.3.5 on rails 2.3.4 not working

**URL:** <https://www.ruby-forum.com/t/installation-workaround-for-i18n-gem-0-3-5-on-rails-2-3-4-not-working/184655>\
**Category:** Rails I18n\
**Created:** [March 5, 2010, 10:06pm UTC](https://www.ruby-forum.com/t/installation-workaround-for-i18n-gem-0-3-5-on-rails-2-3-4-not-working/184655 "2010-03-05T22:06:21Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ginger72](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@ginger72](https://www.ruby-forum.com/u/ginger72)\
**Post date:** [March 5, 2010, 10:06pm UTC](https://www.ruby-forum.com/t/installation-workaround-for-i18n-gem-0-3-5-on-rails-2-3-4-not-working/184655/1 "2010-03-05T22:06:21Z")

</div>

I am using the installation description on

> **[GitHub - ruby-i18n/i18n: Internationalization (i18n) library for Ruby](https://github.com/ruby-i18n/i18n)**
>
> Internationalization (i18n) library for Ruby. Contribute to ruby-i18n/i18n development by creating an account on GitHub.

where I have downloaded the gem into vendor/plugins/i18 and added the  
following lines, as suggested, to an intitializer (i18n.rb):

def reload\_i18n!  
raise “Move to i18n version 0.2.0 or greater” if Rails.version \>  
“2.3.4”  
$:.grep(/i18n/).each { |path| $:.delete(path) }  
I18n::Backend.send :remove\_const, “Simple”  
$: \<\< Rails.root.join(‘vendor’, ‘plugins’, ‘i18n’, ‘lib’).to\_s  
end  
reload\_i18n!

Then in the console I18n.t :hello would returns “Translation missing”

Unfortunately, due to other incompatibilities (Unicorn), I don’t want  
to upgrade to rails 2.3.5.

P.S. Working on a plugin that offers a migration path from Globalize1  
apps to I18n+Globalize2

---

<div class="post-metadata">

**Author:** ![ginger72](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@ginger72](https://www.ruby-forum.com/u/ginger72)\
**Post date:** [March 5, 2010, 10:33pm UTC](https://www.ruby-forum.com/t/installation-workaround-for-i18n-gem-0-3-5-on-rails-2-3-4-not-working/184655/2 "2010-03-05T22:33:16Z")

</div>

Below I copied the installation instructions from

> **[GitHub - ruby-i18n/i18n: Internationalization (i18n) library for Ruby](https://github.com/ruby-i18n/i18n)**
>
> Internationalization (i18n) library for Ruby. Contribute to ruby-i18n/i18n development by creating an account on GitHub.

It does not work with either version of the i18n gem.

Any help to get the i18n gem work on rails 2.3.4 is highly  
appreciated.

Kind regards,

Juergen

* * *

Installation on Rails \< 2.3.5 (deprecated)  
Up to version 2.3.4 Rails will not accept i18n gems \> 0.1.3. There is  
an unpacked  
gem inside of active\_support/lib/vendor which gets loaded unless gem  
‘i18n’, ‘~\> 0.1.3’.  
This requirement is relaxed in 6da03653

The new i18n gem can be loaded from vendor/plugins like this:

## def reload\_i18n! raise “Move to i18n version 0.2.0 or greater” if Rails.version \> “2.3.4” $:.grep(/i18n/).each { |path| $:.delete(path) } I18n::Backend.send :remove\_const, “Simple” $: \<\< Rails.root.join(‘vendor’, ‘plugins’, ‘i18n’, ‘lib’).to\_s end Then you can `reload_i18n!` inside an i18n initializer.

---

<div class="post-metadata">

**Author:** ![ginger72](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@ginger72](https://www.ruby-forum.com/u/ginger72)\
**Post date:** [March 6, 2010, 7:21pm UTC](https://www.ruby-forum.com/t/installation-workaround-for-i18n-gem-0-3-5-on-rails-2-3-4-not-working/184655/3 "2010-03-06T19:21:04Z")

</div>

Hi Sven,

thanks for your quick reply. That is an option I had considered, but  
was way too overconfident that the published code must have worked.

Anyway, all is good now, thanks again.

Kind regards,  
Juergen

---

<div class="post-metadata">

**Author:** ![ginger72](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/97f17d/32.png) [@ginger72](https://www.ruby-forum.com/u/ginger72)\
**Post date:** [March 6, 2010, 12:57am UTC](https://www.ruby-forum.com/t/installation-workaround-for-i18n-gem-0-3-5-on-rails-2-3-4-not-working/184655/4 "2010-03-06T00:57:14Z")

</div>

Juergen,

I’m not sure how this has made it into the readme, but … it might be  
easier for you to just patch Rails here. You could just freeze Rails to  
vendor/rails and apply some patch that changes these lines:

> <https://github.com/rails/rails/blob/v2.3.4/activesupport/lib/active_support/vendor.rb#L23-28>

to match these:

> <https://github.com/rails/rails/blob/v2.3.5/activesupport/lib/active_support/vendor.rb#L23-28>

After that Rails should pick up whatever I18n gem version you’ve  
installed as long as it’s \>= 0.1.3
