# Textmate pulling wrong gems in leopard

**URL:** <https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169>\
**Category:** Rails\
**Created:** [April 8, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169 "2008-04-08T16:03:27Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [April 8, 2008, 4:03pm UTC](https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169/1 "2008-04-08T16:03:27Z")

</div>

when trying to run a ruby test in textmate i get the following:

Missing the Rails 2.0.2 gem. Please `gem install -v=2.0.2 rails`,  
update your RAILS\_GEM\_VERSION setting in config/environment.rb for the  
Rails version you do have installed, or comment out RAILS\_GEM\_VERSION  
to use the latest version installed.

it is using the version of ruby that comes packaged with leopard not  
the one that i compiled in /usr/local

anyone know how to change that?

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [April 8, 2008, 11:29pm UTC](https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169/2 "2008-04-08T23:29:45Z")

</div>

You can your PATH variable to have /usr/local/bin come first. I don’t  
have Leopard so I can’t check the defaults, but if the system (/bin)  
directories (or wherever they put are not listed in your home folder  
bash profile (~/.bash\_profile), then check the root-level (/etc/  
profile) configuration, and insert it there. Since it’s at the root  
level, you can only change it like this:

sudo vim /etc/profile (entering your admin password thereafter)

/etc/profile is loaded before any user profiles, and it affects the  
PATH environment variable of ALL users of your Mac. (It won’t hurt  
anyone who doesn’t use anything in /usr/local/bin, it just ensures  
that binaries there have precedence.)

The version of ruby isn’t the only thing, though. The error shown  
below is telling you that the rails gem being asked for in  
environment.rb is not the same one it sees. I’m not sure if changing  
the path (to see the version of ruby you want) will affect where it  
looks for gems, but it might. Try it and see.

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [April 8, 2008, 11:30pm UTC](https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169/3 "2008-04-08T23:30:56Z")

</div>

Errrr: You can _change_ your PATH variable…

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [April 8, 2008, 11:47pm UTC](https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169/4 "2008-04-08T23:47:53Z")

</div>

On 8 Apr 2008, at 14:52, Josh wrote:

> 

Have you tried setting the TM\_RUBY environment variable to point at  
your ruby binary (in the advanced bit of textmate’s prefs) ?

Fred

---

<div class="post-metadata">

**Author:** ![jjkiesch](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/bc79bd/32.png) [@jjkiesch](https://www.ruby-forum.com/u/jjkiesch)\
**Post date:** [April 8, 2008, 11:57pm UTC](https://www.ruby-forum.com/t/textmate-pulling-wrong-gems-in-leopard/134169/5 "2008-04-08T23:57:51Z")

</div>

changing TM\_RUBY lets my run my tests.

my PATH had /usr/local/bin first, and when in the commend line, rails -  
v outputs 2.0.2

for some reason though, the generators still do not do anything other  
than tell me that the action has been completed. no errors. nothing.
