I have TM_RUBY specified to point to rvm's textmate_ruby. When opening TextMate using 'mate .' it subsequently uses the system ruby, but not the system gemset, and bundle commands start to fail because of incompatabilities.
When opening TextMate directly, or it is already open when I use mate, all is well.
Where the actual problem lies is difficult to tell, and I don't need a solution now I've worked out how to avoid it, but did figure that it'd be helpful to mention.
Cheers, Simon
On Sep 21, 2012, at 4:37 AM, "Simon Gregory" mr.simon.gregory@gmail.com wrote:
I have TM_RUBY specified to point to rvm's textmate_ruby. When opening TextMate using 'mate .' it subsequently uses the system ruby, but not the system gemset, and bundle commands start to fail because of incompatabilities.
When opening TextMate directly, or it is already open when I use mate, all is well.
Where the actual problem lies is difficult to tell, and I don't need a solution now I've worked out how to avoid it, but did figure that it'd be helpful to mention.
I had a similar problem, and it ended up that it was because I had both TM1 and TM2 installed, and it was picking up protocol registration from TM1. Try uninstalling it, and just going 100% with TM2.
Gregg
Cheers, Simon
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On Sep 21, 2012, at 1:37 PM, Simon Gregory mr.simon.gregory@gmail.com wrote:
I have TM_RUBY specified to point to rvm's textmate_ruby. When opening TextMate using 'mate .' it subsequently uses the system ruby, but not the system gemset, and bundle commands start to fail because of incompatabilities.
Are you talking about bundle commands or user scripts (⌘R)?
In either case, I guess the issue is that you have gems installed in ~/.gems (or whatever the folder is) which will be picked up by all versions of ruby!?!
Though no bundle commands actually use ruby gems, so, ehm… which bundle commands actually fail?
When opening TextMate directly, or it is already open when I use mate, all is well.
OK, so I suspect the issue is that you have set RUBYLIB, RUBYOPT, or similar in your shell. When you launch TextMate from your shell, this environment is inherited and would explain why the ruby TextMate use would get your third party gems…
Presently I use a blacklist for the inherited environment, I’ll add RUBY* to this list, although it might perhaps be better to move to whitelisting the variables we do wish to inherit.
I have TM_RUBY specified to point to rvm's textmate_ruby. When opening TextMate using 'mate .' it subsequently uses the system ruby, but not the system gemset, and bundle commands start to fail because of incompatabilities.
Are you talking about bundle commands or user scripts (⌘R)?
Bundle commands.
In either case, I guess the issue is that you have gems installed in ~/.gems (or whatever the folder is) which will be picked up by all versions of ruby!?!
This is happening at the granular level I'd expect when using rvm and isolated gemsets, here's the error message:
/Users/simon/.rvm/gems/ruby-1.9.3-p194@imp/gems/nokogiri-1.4.7/lib/nokogiri/nokogiri.bundle: [BUG] Segmentation fault ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
The gemset it's picking up is the one for the local project, as defined in the projects .rvmrc file.
Though no bundle commands actually use ruby gems, so, ehm… which bundle commands actually fail?
It's in an in development branch of the ActionScript 3 bundle - and as it extends autocompletion it's used by a few people.
When opening TextMate directly, or it is already open when I use mate, all is well.
OK, so I suspect the issue is that you have set RUBYLIB, RUBYOPT, or similar in your shell. When you launch TextMate from your shell, this environment is inherited and would explain why the ruby TextMate use would get your third party gems… Presently I use a blacklist for the inherited environment, I’ll add RUBY* to this list, although it might perhaps be better to move to whitelisting the variables we do wish to inherit.
`env` doesn't list anything starting with RUBY. However it looks like rvm is setting GEM_HOME and GEM_PATH and TextMate is inheriting them.
I think that my assumption that TM_RUBY was working globally is wrong, if I run `ruby -v` via Bundles > Shell Script > Execute Line this is always the system ruby - 1.8.7. ⌘R on a .rb file containing puts ENV['RUBY_VERSION'] gives me the expected version as configured by textmate_ruby.
I'll check through the TextMate docs and see if I can get a better handle on scope and see if I can work things out.
Cheers, Simon
On Sep 24, 2012, at 11:29 AM, Simon Gregory mr.simon.gregory@gmail.com wrote:
[…] `env` doesn't list anything starting with RUBY. However it looks like rvm is setting GEM_HOME and GEM_PATH and TextMate is inheriting them.
Did you try with r9313? Here I have TextMate only inherit whitelisted variables.