TextMate 1 on Yosemite

I’m still using TextMate 1.x and therefore need Ruby 1.8 to use the subversion bundle.

It seems that the quickest workaround to get this working on OS X 10.10 Yosemite is to compile and install Ruby 1.8

Here are the brief instructions.

You will need a compiler. So, you’ll need XCode and maybe X11.
http://xquartz.macosforge.org/downloads/SL/XQuartz-2.7.7.dmg

Get the source code:

mkdir -p ~/src/ruby
cd ~/src/ruby
svn co http://svn.ruby-lang.org/repos/ruby/tags/v1_8_7_374
cd v1_8_7_374

Setup your environment

export PATH=/Developer/usr/bin:$PATH
export LDFLAGS=-L/opt/X11/lib
export CPPFLAGS=-I/opt/X11/include

Link autoconf so that it can be found

sudo ln -s /Developer/usr/share/autoconf /usr/share

Configure and build

autoconf
./configure --prefix=/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr
make
make install

More TextMate subversion Ruby problems after recent upgrade

After the recent upgrade it seems that TextMate and Ruby are no longer friends.

Are you seeing errors like:

/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’: /Applications/TextMate.app/Contents/SharedSupport/Support/lib/shelltokenize.rb:74: invalid multibyte escape: /[^\w_\-\+=\/\x7F-\xFF]/ (SyntaxError) from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:55:in `require’ from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Subversion.tmbundle/Support/format_status.rb:4:in `

I think I have a more permanent fix this time. If you read my previous post you sill see that the moving the current Ruby link is no longer working. Also, if you set the TM_RUBY variable, this too does not fix the problem.

Todays workaround is to update the PATH environment variable within TextMate to include Ruby 1.8 fist in the list.

To do this:

  1. Open TextMate
  2. Open the preferences pane  TextMate -> Preferences
  3. Select the Advanced tab
  4. Select Shell Variables
  5. Edit the PATH variable. Add to the beginning
    • /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin:
  6. Done.

Yosemite Update

See https://hootbah.co.uk/2014/10/22/textmate-1-on-yosemite/

TextMate svn log output problems

Since thew upgrade to Mavericks the output from the subversion log command in TextMate has not worked correctly. It seems that the problem is caused by a change to the xml output from subversion which the TextMate format log script is not picking up.

Essentially the problem is the encoding line has changed from utf-8 to UTF-8.

To fix the problem edit the file: /Applications/TextMate.app/Contents/SharedSupport/Bundles/Subversion.tmbundle/Support/format_log_xml.rb  To edit in TextMate this would be:

mate /Applications/TextMate.app/Contents/SharedSupport/Bundles/Subversion.tmbundle/Support/format_log_xml.rb

Change line 151 from:

if line =~ /^(.*)<\?xml version="1\.0"( encoding="utf-8")?\?>$/

to:

if line =~ /^(.*)<\?xml version="1\.0"((?i) encoding="utf-8")?\?>$/

The log format should be back.

TextMate Ruby error with Mac OS X Mavericks

Are you getting a TextMate error like this after upgrading your Mac to Mavericks

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/ui.rb:129: warning: assigned but unused variable - pid
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/progress.rb:57: warning: shadowing outer local variable - params
/Applications/TextMate.app/Contents/SharedSupport/Support/lib/progress.rb:55: warning: assigned but unused variable - ui_process
/System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require': /Applications/TextMate.app/Contents/SharedSupport/Support/lib/shelltokenize.rb:74: invalid multibyte escape: /[^\w_\-\+=\/\x7F-\xFF]/ (SyntaxError)
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Subversion.tmbundle/Support/svn_diff.rb:7:in `<top (required)>'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/lib/ruby/2.0.0/rubygems/core_ext/kernel_require.rb:45:in `require'
from -:3:in `<main>'

To fix. Simply downgrade the version of Ruby from 2.0 to 1.8. Both versions are installed. So it is as simple as changing a symbolic link.

Open Terminal which can be found in /Applications/Utilities then run the following commands:

cd /System/Library/Frameworks/Ruby.framework/Versions
sudo rm Current
sudo ln -s 1.8 Current