V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
sangwei
V2EX  ›  Ruby

How to log to a temp file in Ruby?

  •  
  •   sangwei · 2013-05-23 12:06:52 +08:00 · 4718 次点击
    这是一个创建于 3962 天前的主题,其中的信息可能已经有所发展或是发生改变。
    从来没弄过 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 条回复    1970-01-01 08:00:00 +08:00
    sangwei
        1
    sangwei  
    OP
       2013-05-23 12:12:39 +08:00
    搞定了,插入位置不对~
    sevk
        3
    sevk  
       2013-08-02 16:41:52 +08:00
    这个也不错哦哦
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   1635 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 23ms · UTC 16:51 · PVG 00:51 · LAX 09:51 · JFK 12:51
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.