在将Heroku应用程序从Bamboo迁移到Cedar时,我得到了这个意想不到的错误:
app[web.1]: Exiting
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/rack/log_tailer.rb:8:in `initialize'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:247:in `new'
app[web.1]: /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/rack/log_tailer.rb:8:in `size': No such file or directory - log/production.log (Errno::ENOENT)
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:247:in `block in build_app'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:243:in `build_app'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:253:in `wrapped_app'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:204:in `start'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands/server.rb:65:in `start'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands.rb:30:in `block in <top (required)>'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands.rb:27:in `tap'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/rack-1.2.8/lib/rack/server.rb:243:in `reverse_each'
app[web.1]: from /app/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/commands.rb:27:in `<top (required)>'
app[web.1]: from script/rails:6:in `<main>'
app[web.1]: from script/rails:6:in `require'
heroku[web.1]: State changed from starting to crashed
最重要的一行:
/app/供应商/包/ruby/rails 2.0.0/珠宝/railties-3.0.19/lib//架/log_tailer。rb:8:in ' size': No such file or directory - log/production.log (Errno:: enent)
- 我的源代码中没有
production.log
。 - 我的
config/environments/production.rb
说config.logger = Logger.new(STDOUT)
。 - 我在源代码的几十个地方使用
logger.debug
。
Heroku甚至不允许写入文件系统,所以我不知道这是从哪里来的。
知道我该怎么修吗?
我从文件config/environments/production.rb
中删除了config.logger = Logger.new(STDOUT)
行,这就解决了问题。