Note that there are some explanatory texts on larger screens.

plurals
  1. PORuby, Mac, Geektool question, file access rights?
    text
    copied!<p>I have a Ruby script that I built in <a href="http://en.wikipedia.org/wiki/TextMate" rel="nofollow noreferrer">TextMate</a> and can successfully run in TextMate. I can also successfully run this script straight from the terminal.</p> <p>The script has this chunk of code in it:</p> <pre><code># Get the XML file puts 'Opening the file' open("messages.xml", "r") do |f| puts 'File is opened' theXML = Hpricot::XML(f) puts 'Trying to get the message_entity' message_entity = GetMessage(theXML) # Build the system command puts 'Getting the author and the message' theAuthor = message_entity.search(:author).text theMessage = message_entity.search(:messagetext).text # Get the correct image for this author theAuthorImage = '' case theAuthor when 'James' : theAuthorImage = 'images/me32.png' when 'Zuzu' : theAuthorImage = 'images/Zuzu32.png' end puts "/usr/local/bin/growlnotify '" + theAuthor + " says' -m '" + theMessage + "' -n 'Laurens Notes' --image '" + theAuthorImage + "'" #system("/usr/local/bin/growlnotify '" + theAuthor + " says' -m '" + theMessage + "' -n 'Laurens Notes' --image '" + theAuthorImage + "'") end puts 'The End' </code></pre> <p>When the script is run by <a href="http://projects.tynsoe.org/en/geektool/" rel="nofollow noreferrer">GeekTool</a>, it never gets past <code>puts 'File is opened'</code>. It doesn't even hit <code>puts 'The End'</code>. It gives no error at all.</p> <p>The script is under a folder under the <code>/System</code> folder on my Mac, but I have changed the file permissions to allow "everyone" to have "read &amp; write" access. <strong>EDIT</strong> I just copied the files to a folder directly under my user home folder, and it still has the issue in GeekTool but not in TextMate or straight through the Terminal.</p> <p><strong>END EDIT</strong></p> <p><strong>2nd Edit</strong></p> <p>I think GeekTool may have an issue with paths to files maybe.</p> <p>For example, I changed the program to just read the XML file straight from the Internet for now and it does that just fine, but there are some images that the program is using for the icons in <a href="http://growl.info/extras.php" rel="nofollow noreferrer">growlnotify</a>. When run through TextMate, these icons display perfectly. When run using GeekTool...nope. No custom icon at all.</p> <p>It's as if GeekTool just can't handle the file paths correctly. When I do <code>puts __FILE__.to_s</code> it gives me the correct filepath to my .rb file though.</p> <p>** end 2nd edit** What should I do?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload