[SVN] TextMate and Ruby

Sylvain Desvé sylvain.desve at mines.inpl-nancy.fr
Sat Aug 25 09:26:49 UTC 2007


Hello,

I have a problem with the way TextMate fills the Ruby $LOAD_PATH  
variable. I have two versions of Ruby on my computer : the version OS  
X ships with (1.8.2) and the version I installed myself (1.8.6).

I created a new test command with the following script :

	/usr/bin/env ruby -w

When I trigger my command I get ruby 1.8.6, so it's fine.

Then I created a new command with :

	#!/usr/bin/env ruby
	require "rbconfig"
	puts $LOAD_PATH
	puts Config::CONFIG['TEENY']

When I use it I get:

	/usr/lib/ruby/site_ruby/1.8
	/usr/lib/ruby/site_ruby/1.8/powerpc-darwin8.0
	/usr/lib/ruby/site_ruby/1.8/universal-darwin8.0
	/usr/lib/ruby/site_ruby
	/usr/lib/ruby/1.8
	/usr/lib/ruby/1.8/powerpc-darwin8.0
	/usr/lib/ruby/1.8/universal-darwin8.0
	.
	2

So the command is using the latest version of ruby but fill the  
$LOAD_PATH with paths from the former version.

Moreover, /usr/lib/ruby/site_ruby/1.8/powerpc-darwin8.0 does not  
exist on my computer so it makes the Completion: require strings  
Preference Item to abort since it tries a Dir.new() on that path.

I managed to fix the completion command by replacing #!/usr/bin/env  
ruby with #!/usr/local/bin/ruby which is the actual path to the  
latest version of the ruby interpreter.

Thanks,
Sylvain



More information about the textmate-dev mailing list