White Space


让 textmate 支持 rvm

Text

使用 rvm 对多个 ruby 版本进行管理非常方便,但导致 textmate 无法正常编译 ruby,错误信息如下:

/Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb:169:in `fcntl’: Inappropriate ioctl for device (Errno::ENOTTY) from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb:169:in `run’ from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:211:in `parse_version’ from /Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/executor.rb:98:in `run’ from /Applications/TextMate.app/Contents/SharedSupport/Bundles/Ruby.tmbundle/Support/RubyMate/run_script.rb:93:in `’

解决办法是:

  • 步骤一:textmate 的 Shell Variables 添加 TM_RUBY,值为 /Users/[username]/.rvm/bin/rvm-auto-ruby, username 替换为你自己的用词名,参考此图 http://cl.ly/23Yl
  • 步骤二:注释掉 /Applications/TextMate.app/Contents/SharedSupport/Support/lib/tm/process.rb 的 169 行(io[0][0].fcntl(6, ENV[‘TM_PID’].to_i) if ENV.has_key? ‘TM_PID’)



October 14, 2010, 10:47pm