Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Have Rails 2.3.x ignore the i18n gem

I have a Rails 2.3.5 project that uses the localization features of Rails. I also happen to have Rails 3 beta installed (which depends on the i18n gem). Rails 2.3.5 will happily handle localization on it's own (without i18n installed), however if the i18n gem is available, it makes use of it.

Recently I upgraded my gems and now have version 0.3.7 and 0.4.0 of i18n installed. Rails, of course, wants to load and use the latest version which is causing errors in my project. I tried setting the gem version to 0.3.7 which gets around the errors in the web app. However, we're using resque and resque_mailer to delay the sending of messages. When the worker picks up the mailer job from the queue, it ignores my config.gem requirement in environment.rb and uses version 0.4.0 anyway.

Ideally, I'd like to tell Rails to just not use the i18n gem at all. How do I do that?

Update: As of beta 4, Rails 3 now requires i18n version 0.4.1. I don't see how more people aren't running into this problem as it would seem now if you have both Rails 2 and Rails 3 installed, you're going to run into this.

like image 986
Jared Avatar asked Jun 04 '10 15:06

Jared


2 Answers

I followed instructions as defined here:

http://gembundler.com/rails23.html

and it worked.

like image 116
paulbjensen Avatar answered Sep 19 '22 17:09

paulbjensen


You could use Bundler or RVM's Gemsets to make the i18n gem unavailable from within your app. Or you could upgrade your Rails app.

like image 30
Konstantin Haase Avatar answered Sep 20 '22 17:09

Konstantin Haase