NOTE: user377519 (answer below) pointed me in the right direction. I've posted the 'fix' at the bottom of the questions, in case you found this and need more than a 'pointer'
I can't figure out why the second call to "gem env" doesn't have the same environment as the first? Any pointers? This is driving me crazy!!!!
$ which gem
/usr/local/bin/gem
$ /usr/local/bin/gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.8 (2010-06-26 patchlevel 1) [i386-darwin9.8.0]
- INSTALLATION DIRECTORY: /usr/local/lib/ruby/gems/1.8
- RUBY EXECUTABLE: /usr/local/bin/ruby
- EXECUTABLE DIRECTORY: /usr/local/bin
- RUBYGEMS PLATFORMS:
- ruby
- x86-darwin-9
- GEM PATHS:
- /usr/local/lib/ruby/gems/1.8
- /Users/pauliprice/.gem/ruby/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com", "http://gems.github.com"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
- http://gems.github.com
$ gem env
RubyGems Environment:
- RUBYGEMS VERSION: 1.3.7
- RUBY VERSION: 1.8.6 (2009-06-08 patchlevel 369) [universal-darwin9.0]
- INSTALLATION DIRECTORY: /Library/Ruby/Gems/1.8
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /usr/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-9
- GEM PATHS:
- /Library/Ruby/Gems/1.8
- /Users/pauliprice/.gem/ruby/1.8
- /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/gems/1.8
- GEM CONFIGURATION:
- :update_sources => true
- :verbose => true
- :benchmark => false
- :backtrace => false
- :bulk_threshold => 1000
- :sources => ["http://gems.rubyforge.org/", "http://gems.github.com", "http://gems.github.com"]
- REMOTE SOURCES:
- http://gems.rubyforge.org/
- http://gems.github.com
- http://gems.github.com
SOLUTION:
Given that you don't (as I do not) want to switch between different versions, merely install a new version, on you OSX 10.5 box, this is how to get RubyGems installed correctly.
Assuming you built and installed your new Ruby like this:
./configure --prefix=/usr/local --enable-pthread
sudo make
sudo make install
edit your ~/.bash_profile and add this line
export PATH=/usr/local/bin:$PATH
Save and refresh your terminal. Then you should install RubyGems like this:
Download and setup latest rubygems
wget http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
tar -xzv http://rubyforge.org/frs/download.php/70696/rubygems-1.3.7.tgz
cd rubygems-1.3.7
sudo su
# export PREFIX=/usr/local
# export GEM_HOME=$PREFIX/lib/ruby/gems/1.8
# export RUBYLIB=$PREFIX/lib/ruby:$PREFIX/lib/site_ruby/1.8
# ruby setup.rb all —prefix=$PREFIX
exit
edit ~/.bash_profile and add the following lines
export PREFIX=/usr/local
export GEM_HOME=$PREFIX/lib/ruby/gems/1.8
export RUBYLIB=$PREFIX/lib/ruby:$PREFIX/lib/site_ruby/1.8
And you're all good. Refresh Terminal,