将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/vendor/bundle/ruby/2.0.0/gems/railties-3.0.19/lib/rails/rack/log_tailer.rb:8:in`size':没有这样的文件或目录 - 日志/production.log(Errno :: ENOENT)
production.log
。config/environments/production.rb
说config.logger = Logger.new(STDOUT)
。logger.debug
。Heroku甚至不允许写入文件系统,因此我不知道它来自何处 知道如何解决它吗?
答案 0 :(得分:0)
我从文件config.logger = Logger.new(STDOUT)
中删除了行config/environments/production.rb
,这解决了问题。
服务器现已成功启动。