0

我有一个使用工头 0.78.0 运行的 rails 4.2.1 应用程序

每当我尝试使用“puts”在控制台中记录一个值时,没有任何附加内容。我尝试用谷歌搜索一下,但没有找到可行的解决方案。

我试图在我的 development.rb 中添加 $stdout.sync = true 但到目前为止没有结果(是的,我重新启动了工头)

由于我的应用程序使用 angularjs 运行,因此当某些内容仅在服务器端附加而没有任何日志时,往往很难调试。

有没有办法在控制台中输出日志并解决这个问题?我知道这一定是配置问题,因为我的一些同事可以在同一个项目中做到这一点。我只是看不出他们和我的区别。

这是我启动工头时唯一能看到的输出。

09:53:15 web.1    | started with pid 68370
09:53:15 worker.1 | started with pid 68371
09:53:17 web.1    | [68370] Puma starting in cluster mode...
09:53:17 web.1    | [68370] * Version 2.11.2 (ruby 2.2.2-p95), codename: Intrepid Squirrel
09:53:17 web.1    | [68370] * Min threads: 1, max threads: 4
09:53:17 web.1    | [68370] * Environment: development
09:53:17 web.1    | [68370] * Process workers: 2
09:53:17 web.1    | [68370] * Phased restart available
09:53:17 web.1    | [68370] * Listening on tcp://0.0.0.0:5060
09:53:17 web.1    | [68370] Use Ctrl-C to stop
09:53:29 web.1    | /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::XLSX
09:53:29 web.1    | /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of XLSX was here
09:53:29 web.1    | /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::XLSX
09:53:29 web.1    | /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of XLSX was here
09:53:29 worker.1 | /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/http/mime_type.rb:163: warning: already initialized constant Mime::XLSX
09:53:29 worker.1 | /Users/myuser/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.1/lib/action_dispatch/http/mime_type.rb:163: warning: previous definition of XLSX was here
09:53:29 web.1    | [68370] - Worker 0 (pid: 68372) booted, phase: 0
09:53:29 web.1    | [68370] - Worker 1 (pid: 68373) booted, phase: 0
09:53:32 worker.1 | 2015-07-14T13:53:32.801Z 68371 TID-ow3bp4a9w INFO: Running in ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14]
09:53:32 worker.1 | 2015-07-14T13:53:32.801Z 68371 TID-ow3bp4a9w INFO: See LICENSE and the LGPL-3.0 for licensing details.
09:53:32 worker.1 | 2015-07-14T13:53:32.801Z 68371 TID-ow3bp4a9w INFO: Upgrade to Sidekiq Pro for more features and support: http://sidekiq.org/pro
09:53:32 worker.1 | 2015-07-14T13:53:32.801Z 68371 TID-ow3bp4a9w INFO: Booting Sidekiq 3.3.4 with redis options {:url=>nil}
09:53:32 worker.1 | 2015-07-14T13:53:32.801Z 68371 TID-ow3bp4a9w INFO: Starting processing, hit Ctrl-C to stop

提前感谢您的时间。

4

1 回答 1

0

问题不在于工头……经过 3 小时的调试后,我发现是电源误导了信息……不知道为什么,但通过使用符号链接,控制台中没有显示任何内容。当我尝试使用我的 IP 地址时,它起作用了......不太清楚为什么,但只要它解决了问题,一切都很好。

于 2015-07-14T15:30:36.433 回答