I installed ruby 1.8.5 and appscript on my mac (and it is hugely better that the schizolanguage of AppleScript).
Now if I define a command in TextMate like
#!/usr/bin/env ruby require "appscript" include Appscript te = app('TextEdit')
TextMate complains it (he) cannot find appscript.rb (no use to give the explicit path since then TextMate cannot find the files require'd inside appscript, etc etc).
Clearly, I must set new paths, but how? and maybe I should also tell TextMate to use 1.8.5 instead of 1.8.2 I'm sure this is easy but have no idea how to do it. Any help?
Thanks a lot, Piero
Piero D'Ancona wrote:
I installed ruby 1.8.5 and appscript on my mac (and it is hugely better that the schizolanguage of AppleScript).
Now if I define a command in TextMate like
#!/usr/bin/env ruby require "appscript" include Appscript te = app('TextEdit')
TextMate complains it (he) cannot find appscript.rb (no use to give the explicit path since then TextMate cannot find the files require'd inside appscript, etc etc).
Clearly, I must set new paths, but how? and maybe I should also tell TextMate to use 1.8.5 instead of 1.8.2 I'm sure this is easy but have no idea how to do it. Any help?
Where did you install ruby 1.8.5? Make sure that's in your PATH. "ruby -v" in Terminal should say 1.8.5 if it is.
See under the heading "Paths" here for more info: http://hivelogic.com/narrative/articles/ruby-rails-mongrel-mysql-osx
On 3/6/07, Piero D'Ancona pierodancona@gmail.com wrote:
I installed ruby 1.8.5 and appscript on my mac (and it is hugely better that the schizolanguage of AppleScript).
Now if I define a command in TextMate like
#!/usr/bin/env ruby require "appscript" include Appscript te = app('TextEdit')
TextMate complains it (he) cannot find appscript.rb (no use to give the explicit path since then TextMate cannot find the files require'd inside appscript, etc etc).
Clearly, I must set new paths, but how? and maybe I should also tell TextMate to use 1.8.5 instead of 1.8.2 I'm sure this is easy but have no idea how to do it. Any help?
Thanks a lot, Piero
paths and gui applications are a bit complex, if you aren't using bash, textmate won't absorb your path environment variable without defining it in ~/.MacOSX/environment.plist. for more info: http://macromates.com/textmate/manual/shell_commands
cheers, jean-pierre
Did you install appscript as a gem? If so you may need to add:
export RUBYOPT=rubygems
to your .bashrc, or .bash-login, or whatever.
Jake
Piero D'Ancona wrote:
I installed ruby 1.8.5 and appscript on my mac (and it is hugely better that the schizolanguage of AppleScript).
Now if I define a command in TextMate like
#!/usr/bin/env ruby require "appscript" include Appscript te = app('TextEdit')
TextMate complains it (he) cannot find appscript.rb (no use to give the explicit path since then TextMate cannot find the files require'd inside appscript, etc etc).
Clearly, I must set new paths, but how? and maybe I should also tell TextMate to use 1.8.5 instead of 1.8.2 I'm sure this is easy but have no idea how to do it. Any help?
Thanks a lot, Piero
For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate
Thanks all, problem solved. Jean-Pierre was right, the problem is explained in TextMate's manual. A shebang command (like a ruby command) in TextMate does not read the path set in .bash_profile but relies on the path for GUI's which is set in ~/.MacOSX/environment.plist
So I opened this file and shifted at the beginning of the path the "/usr/local/bin" piece, and now everything works. Btw, appscript is great.
This is maybe the third time I fall into this trap...
Thanks a lot Piero
PS we have trolls! at last! we are a grown-up community