为什么新记录插入production数据库,而得到更新的却是development.log

使用./script/ruby -e production 在生产模式下启动server,试着插入几条新纪录,发现新的记录被插入到production数据库,但是更新的却是development.log

你可以试下
在config/environment.rb中
[code="ruby"]

Uncomment below to force Rails into production mode when

you don't control web/app server and can't set it the proper way

ENV['RAILS_ENV'] ||= 'production'
[/code]

如果还不行的话
可以试着去对比下config/environments/目录下的几个配置文件