<HTML><BODY style="word-wrap: break-word; -khtml-nbsp-mode: space; -khtml-line-break: after-white-space; "><BR><DIV><DIV>Le 9 mars 06 à 15:45, Allan Odgaard a écrit :</DIV><BR class="Apple-interchange-newline"><BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">Yes, but add it to your ~/.bash_profile or similar (see [1] for what TM sources when running commands).</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <BLOCKQUOTE type="cite"><P style="margin: 0.0px 0.0px 0.0px 10.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">or all of those kind of setup could be done thru TextMate setup, but how ?</FONT></P> </BLOCKQUOTE><P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">You could also add them to Preferences -> Advanced -> Shell Variables.</FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px"><FONT face="Helvetica" size="3" style="font: 12.0px Helvetica">[1] <A href="http://macromates.com/textmate/manual/shell_commands#search_path">http://macromates.com/textmate/manual/shell_commands#search_path</A></FONT></P> <P style="margin: 0.0px 0.0px 0.0px 0.0px; font: 12.0px Helvetica; min-height: 14.0px"><BR></P> </BLOCKQUOTE></DIV><BR><DIV><BR class="khtml-block-placeholder"></DIV><DIV>ok, thanks, i had read that page and, because i'm using a shebang :</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>#!/usr/bin/env ruby</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>i've augmented the ~/.MacOSX/environment.plist</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>having the content :</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>~%> cat ~/.MacOSX/environment.plist</DIV><DIV><?xml version="1.0" encoding="UTF-8"?></DIV><DIV><!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "<A href="http://www.apple.com/DTDs/PropertyList-1.0.dtd">http://www.apple.com/DTDs/PropertyList-1.0.dtd</A>"></DIV><DIV><plist version="1.0"></DIV><DIV><dict></DIV><DIV>        <key>GEM_HOME</key></DIV><DIV>        <string>/opt/local/lib/ruby/gems/1.8</string></DIV><DIV>        <key>GROOVY_HOME</key></DIV><DIV>        <string>/Users/yvon/bin/groovy</string></DIV><DIV>        <key>HTML_TIDY</key></DIV><DIV>        <string>/Users/yvon/.tidy.rc</string></DIV><DIV>        <key>LC_CTYPE</key></DIV><DIV>        <string>en_US.UTF-8</string></DIV><DIV>        <key>OSXANT_HOME</key></DIV><DIV>        <string>/Users/yvon/bin/OSXAnt</string></DIV><DIV>        <key>PATH</key></DIV><DIV>        <string>/opt/local/bin:/usr/local/bin:/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/Users/yvon/bin:/Developer/qt/bin:/usr/local/pgsql/bin:/Users/yvon/bin/groovy/bin</string></DIV><DIV>        <key>RUBYOPT</key></DIV><DIV>        <string>-rrubygems</string></DIV><DIV></dict></DIV><DIV></plist></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>i've also added a ~/.bash_profile having :</DIV><DIV>[ -f /etc/profile ] && . /etc/profile</DIV><DIV>[ -f ~/.bashrc ]    && . ~/.bashrc</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>export PATH="/opt/local/bin:/usr/local/bin:/usr/local/mysql/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/Users/yvon/bin:/usr/local/pgsql/bin:/Users/yvon/bin/groovy/bin:$PATH"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>export RUBYOPT="-rrubygems"</DIV><DIV>export GEM_HOME="/opt/local/lib/ruby/gems/1.8"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>and finally set the TextMate preferences :</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>TM_RUBY<SPAN class="Apple-tab-span" style="white-space:pre">         </SPAN>/opt/local/bin/ruby</DIV><DIV>RUBYOPT<SPAN class="Apple-tab-span" style="white-space:pre">           </SPAN>-rrubygems</DIV><DIV>GEM_HOME<SPAN class="Apple-tab-span" style="white-space:pre">           </SPAN>/opt/local/lib/ruby/gems/1.8</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>i've tested with a simple script ("try.rb") :</DIV><DIV>#!/usr/bin/env ruby</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>p "#{GEM_HOME}"</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>i get :</DIV><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; background-color: rgb(210, 222, 255); "><FONT class="Apple-style-span" color="#ED5100" face="Lucida Grande" size="4"><SPAN class="Apple-style-span" style="font-size: 13.3px;"><B>NameError</B></SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande" size="4"><SPAN class="Apple-style-span" style="font-size: 13.3px;">: uninitialized constant GEM_HOME</SPAN></FONT></DIV><TABLE cellspacing="0" cellpadding="0" style="padding: 2.0px 0.0px 2.0px 0.0px"><TBODY><TR><TD valign="middle" style="width: 64.0px; padding: 0.0px 2.0px 0.0px 5.0px"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><A href="txmt://open?url=file:///Users/yvon/work/Xslt-xml/LibXml-Ruby/labels.rb&line=3"><FONT class="Apple-style-span" size="4"><SPAN class="Apple-style-span" style="font-size: 13.3px;"><I>at top level</I></SPAN></FONT></A></DIV></TD><TD valign="middle" style="width: 131.0px; padding: 0.0px 2.0px 0.0px 5.0px"><DIV style="margin-top: 0px; margin-right: 0px; margin-bottom: 0px; margin-left: 0px; "><FONT class="Apple-style-span" face="Lucida Grande" size="4"><SPAN class="Apple-style-span" style="font-size: 13.3px;">in <B>try</B></SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande" size="4"><SPAN class="Apple-style-span" style="font-size: 13.3px;"><B>.rb</B></SPAN></FONT><FONT class="Apple-style-span" face="Lucida Grande" size="4"><SPAN class="Apple-style-span" style="font-size: 13.3px;"> at line 3</SPAN></FONT></DIV></TD></TR></TBODY></TABLE><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>the same arroses with the constant TM_RUBY</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>however, changing the above script content to :</DIV><DIV>which_ruby=`which ruby`.chomp</DIV><DIV>p "#{which_ruby}"</DIV><DIV>p $LOAD_PATH</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>i get the correct ruby (dp install) and the correct LOAD_PATH</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>best,</DIV><DIV><BR class="khtml-block-placeholder"></DIV><DIV>Yvon</DIV></BODY></HTML>