textmate pulling wrong gems in leopard

9 views
Skip to first unread message

Josh

unread,
Apr 8, 2008, 9:52:31 AM4/8/08
to Ruby on Rails: Talk
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?

redbaritone

unread,
Apr 8, 2008, 5:29:02 PM4/8/08
to Ruby on Rails: Talk
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.

redbaritone

unread,
Apr 8, 2008, 5:30:02 PM4/8/08
to Ruby on Rails: Talk
Errrr: You can _change_ your PATH variable...

Frederick Cheung

unread,
Apr 8, 2008, 5:46:59 PM4/8/08
to rubyonra...@googlegroups.com

Have you tried setting the TM_RUBY environment variable to point at
your ruby binary (in the advanced bit of textmate's prefs) ?

Fred

Josh

unread,
Apr 8, 2008, 5:57:22 PM4/8/08
to Ruby on Rails: Talk
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.
Reply all
Reply to author
Forward
0 new messages