我在尝试启动服务器时遇到此错误。
logger.rb:541:in `exist?': can't convert Rails::Paths::Path into String (TypeError)
这是我的 development.rb 中的代码。
require 'log_formatter'
config.logger = Logger.new(config.paths.log.first)
config.logger.formatter = LogFormatter.new
config.logger.level = Logger::DEBUG
我试过添加.to_s,但没用。
Google 也无济于事。
最佳答案
在 Rails 3.1.1 中,旧语法已被弃用。你现在应该使用:
config.paths['log'].first
关于ruby-on-rails - Rails 3 中的 config.logger 和 config.paths.log,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4268525/