@ashchan 老帖子,也定一个,赞!
@longerian 还是相当不错的。是不是换公司了,比较忙了就没有时间继续了。
找到问题了,我代码里用了一段 locale 设置,我的浏览器里果然有 locale,值为 zh-cn 小写的,这个是导致问题的根本原因,哎呀,可给折腾了。
def set_locale
I18n.locale = cookies[:locale] || I18n.default_locale
end
好的,谢谢 @lgn21st
谢谢 @lgn21st ,@zhaoguobin 我的版本是 Rails 3.2.13,我把 zh-CN.yml 的 开头 zh-CN: 改成小写的 zh-cn: 之后,就显示正常了。没有明白具体原因,我的设置是大写的:
config.i18n.default_locale = "zh-CN"
嗯,@zfjoy520 谢谢,等待大牛中 是不是需要把 Ubuntu 12 本地的 locale 也修改为中文的?当前是这样的
# locale
LANG=en_US.UTF-8
LANGUAGE=en_US:en
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=
@mingfei ,碰到同样的问题,后面你是怎么解决的?求助,谢谢!
谢谢 @Martin91 ,我已经重新 bundle 了一下,重来了。
Loading development environment (Rails 3.2.13) 1.9.3-p484 :001 > Rails.env => "development" 1.9.3-p484 :004 > quit i# RAILS_ENV=production rails console Loading production environment (Rails 3.2.13) 1.9.3-p484 :001 > Rails.en => "production"
如 stackoverflow 哥们说的,关键是要精确制定版本好: Always add version to critical gems. Always use bundle install or bundle(default to install). Only use bundle update when it's really necessary and you are fully prepared.
@Martin91 ,恢复一批已经升级的 gem,有快捷的方法吗?
自己更新一下进展, 找到一篇最新的文章,描述这个问题: http://stackoverflow.com/questions/19948584/bootstrap-not-work-in-rails-application 大意是 bootstrap 的版本有问题;我看了一下老版本的配置文件
Bootstrap-responsive has been removed since Bootstrap 3.0.
3.0 is mobile first design, and responsiveness is native now.
Remove that require statement, no need now.
Update
Dexter(OP) finally solved the problem by going back to 2.3. Though the case is rare, I think two lessons can be learned:
Always add version to critical gems.
Always use bundle install or bundle(default to install). Only use bundle update when it's really necessary and you are fully prepared.
咱,10 秒 bundle 完,救星呀