Hey all,
i thought putting :
TM_RUBY /opt/local/bin/ruby
into :
Preferences > Advanced > Shell Variables
was ok to run a rb file whith this Ruby
but i get allways :
RubyMate r6354 running Ruby r1.8.2 (/usr/bin/ruby)
essai.rb
in the RubyMate Console.
then, the default Apple's Ruby :(
i think the env var name "TM_RUBY" is wrong ?
best,
Yvon
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Strange, it works for me.
Nostalgia-For-Infinity:~ skade$ which ruby /usr/local/bin/ruby Nostalgia-For-Infinity:~ skade$ ruby -v ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1]
TM_RUBY = /usr/local/bin/ruby
RubyMate r6354 running Ruby r1.8.4 (/usr/local//bin/ruby)
test.rb
But I do have some other strange behaviour regarding ruby versions, hinting that there is something wrong with Textmates handling of ruby versions.
Syntax checking (Ctrl-Shift-V) for example has the output: using ruby-1.8.2 Syntax OK
Gruß Florian
Yvon Thoraval wrote:
On 7. Apr 2007, at 11:41, Florian Gilcher wrote:
It does not consistently use TM_RUBY, as it can’t e.g. use it in shebang lines
If you need it to use a custom installed version the only proper way is really to setup your PATH to point at the custom version before the standard version: http://macromates.com/textmate/manual/ shell_commands#search_path
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Hi,
My .bash_login reads (no .bash_profile or .profile in ~):
export PATH="/usr/local/bin:/usr/local/sbin:/opt/local/bin:/usr/local/mysql/bin:$PATH"
# Setting PATH for MacPython 2.5 # The orginal version is saved in .bash_login.pysave PATH="/Library/Frameworks/Python.framework/Versions/Current/bin:${PATH}" export PATH
which should lead to using /usr/local/bin/ruby , my ruby 1.8.4 installation. To make the problem more exciting, the command uses the shebang line:
#!/usr/bin/env ruby
This one points to ruby 1.8.4, too:
Nostalgia-For-Infinity:~ skade$ /usr/bin/env ruby -v ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1]
Digging further, i modified the command 'Validate Syntax':
#!/usr/bin/env ruby require ENV['TM_SUPPORT_PATH'] + '/lib/textmate' puts "using ruby-" + RUBY_VERSION.to_s result = `"${TM_RUBY:=ruby}" -wc 2>&1` puts result TextMate.go_to :line => $1 if result =~ /-:(\d+):/
And changed `"${TM_RUBY:=ruby}" -wc 2>&1` to `"${TM_RUBY:=ruby}" -v´. Running the Command now yields:
using ruby-1.8.2 ruby 1.8.4 (2005-12-24) [i686-darwin8.6.1]
Perhaps i missed something, but i do feel like it doesn't honor the PATH correctly.
On the other hand: version is edge with newest bundles - nothing is perfect.
Meilleures salutations Florian
Allan Odgaard wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
*hmm*
Yes, I did that, but forgot to mention it. But I _also_ forgot to log out after doing this.
Thanks for showing the obvious Florian
P.S.: Fortunately, I'm not one of those RTFM-guys. Otherwise, this would have been my nemesis.
Allan Odgaard wrote:
Le 7 avr. 07 à 12:40, Allan Odgaard a écrit :
thanks for the link however i do have a :
~/.MacOSX/environment.plist having :
[...] <key>PATH</key> <string>/Users/yt/SVN/WebKit/WebKitTools/Scripts:/Users/yt/ bin/ant/bin:/opt/local/bin:/opt/local/sbin:/usr/local/bin:/usr/local/ sbin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/X11R6/bin:/Users/yt/bin:/ Developer/Tools:/System/Library/Frameworks/Python.framework/Versions/ 2.3/bin</string> [...]
(bottom of given link)
in fact my "~/.MacOSX/environment.plist" is a translation of my zsh setup...
and i usually use shebang like that :
#! /usr/bin/env ruby -wx
(for all kind of shell)
nevertheless, ill try-out the .bash_profile given.
best,
Yvon
Le 7 avr. 07 à 15:58, Yvon Thoraval a écrit :
nevertheless, ill try-out the .bash_profile given.
that works ! even without restarting a new session nor restarting TextMate itself.
with the simplest content of .bash_profile :
[ -f /etc/profile ] && . /etc/profile [ -f ~/.bashrc ] && . ~/.bashrc
export PATH="$HOME/bin:/opt/local/bin:$PATH"
thanks to all !
Yvon
On Apr 7, 2007, at 8:58 AM, Yvon Thoraval wrote:
and i usually use shebang like that :
#! /usr/bin/env ruby -wx
Just FYI, it makes no sense to pass Ruby's -x switch in a shebang line. It will never have any effect there, unless you follow it up with a directory name.
James Edward Gray II