sangwei
V2EX  ›  Ruby

How to log to a temp file in Ruby?

  •  
  •   sangwei · May 23, 2013 · 6306 views
    This topic created in 4922 days ago, the information mentioned may be changed or developed.
    从来没弄过 Ruby,最近在配置 Gitlab 碰到问题,想简单调试一下。

    Gitlab 是按照 https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md 来配置的。

    一切都好,除了不能用 LDAP 账号 checkout 代码。

    Google 了一番之后,打算在 /home/git/gitlab/lib/gitlab/backend/grack_auth.rb 中写点日至出来。插入了一行代码:
    File.open('/tmp/ldaplog','a') { |file| file.write("Hello World!\n") }

    这样是不是就该能在 ldaplog 中看到点东西?我啥也没看到,是不是什么地方没搞好?
    3 replies  •  1970-01-01 08:00:00 +08:00
    sangwei
    sangwei
    OP
    May 23, 2013
    1
    搞定了,插入位置不对~
    sevk
    sevk
    Aug 2, 2013
    3
    这个也不错哦哦
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   3900 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 25ms · UTC 09:42 · PVG 17:42 · LAX 01:42 · JFK 04:42
    ♥ Do have faith in what you're doing.