Rails 2.3 + Rails 3 + Authlogic + I18n

本文介绍了当使用Rails 2.3与Authlogic时遇到的I18n兼容性问题及解决方案。针对Rails 3中I18n版本高于Authlogic支持的问题,提供了两种解决方法:一是预加载特定版本的I18n;二是冻结Rails依赖的gem版本。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

If you are using Rails 2.3 Rails 3 Authlogic I18n error wrong number of arguments (4 for 3) (ArgumentError), in consequence of the fact that Rails 3 require I18n> = 0.3.6 version, and Authlogic works with earlier versions of I18n.

One solution to preload the application on Rails 2.3 older version I18n, which will be compatible with Authlogic.

 

問題解決:

方法1:
The process is to create the file config / preinitializer.rb c code download the required version of us:

require 'rubygems'

gem' i18n ', '0 .2.1'

Do not forget to install the appropriate version of the heme: gem install i18n - version = 0.2.1

 

方法2:

Workaround:
rake VERSION=2.3.5 rails:freeze:gems
vim vendor/rails/activesupport/lib/active_support/vendor.rb

gem 'i18n', '>= 0.1.3', '< 0.4.0'

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值