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:
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
On 7. Apr 2007, at 11:41, Florian Gilcher wrote:
[...] But I do have some other strange behaviour regarding ruby versions, hinting that there is something wrong with Textmates handling of ruby versions.
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:
On 7. Apr 2007, at 11:41, Florian Gilcher wrote:
[...] But I do have some other strange behaviour regarding ruby versions, hinting that there is something wrong with Textmates handling of ruby versions.
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
On 7. Apr 2007, at 13:30, Florian Gilcher wrote:
[...] Perhaps i missed something, but i do feel like it doesn't honor the PATH correctly.
Please see the paragraph marked “important” near the bottom at http:// macromates.com/textmate/manual/shell_commands#search_path
The PATH you setup for bash is NOT the PATH variable given to GUI programs in general.
-----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:
On 7. Apr 2007, at 13:30, Florian Gilcher wrote:
[...] Perhaps i missed something, but i do feel like it doesn't honor the PATH correctly.
Please see the paragraph marked “important” near the bottom at http://macromates.com/textmate/manual/shell_commands#search_path
The PATH you setup for bash is NOT the PATH variable given to GUI programs in general.
Le 7 avr. 07 à 12:40, Allan Odgaard a écrit :
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
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
Hello TextMate users,
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 might not always be the best idea to pass any arguments at all in the shebang line, not ever operating system can handle this.
Patrick
On Apr 7, 2007, at 10:32 AM, Patrick Gundlach wrote:
Hello TextMate users,
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 might not always be the best idea to pass any arguments at all in the shebang line, not ever operating system can handle this.
That's true if you use the env trick. I'm pretty sure it is cross- platform portable if you hardcode the path though, as Ruby parses the options itself.
James Edward Gray II
Hello James,
It might not always be the best idea to pass any arguments at all in the shebang line, not ever operating system can handle this.
That's true if you use the env trick. I'm pretty sure it is cross- platform portable if you hardcode the path though, as Ruby parses the options itself.
Yes, I think you are right.
Patrick
Le 7 avr. 07 à 17:24, James Edward Gray II a écrit :
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.
fine thanks to let me know that point, i have to say this is more an habit to put that x, i don't know what it means exactly )))
best,
Yvon