Ruby, Mac, Geektool question, file access rights?

后端 未结 3 862
日久生厌
日久生厌 2021-01-25 06:42

I have a Ruby script that I built in TextMate and can successfully run in TextMate. I can also successfully run this script straight from the terminal.

The script has th

3条回答
  •  既然无缘
    2021-01-25 07:16

    Try wrapping it all in a block like below, which will log to /tmp/geektool.txt. Then you can see if there are any exceptions happening that you aren't aware of (like file permission).

    begin
      #file.open... etc
    rescue Exception => e
      file.open('/tmp/geektool.txt', 'w'){|f| f.puts "#{e}\n\n#{e.backtrace}"}
    end
    

    Also, don't forget there's the ruby-growl gem.

提交回复
热议问题