1
votes

I'm trying to set up a rails app on a production box (no compiler, no root access) that's running Mac OS X Server 10.6.6. It's got ruby 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0], and gem 1.3.5. However I need to install a newer version of rubygems because I need Rails 3 and Bundler. I can't update the system ruby or rubygems.

I tried installing a local version of rubygems (v 1.7.2) but 'gem -v' still returns 1.3.5. 'which gem' definitely points to my local rubygems binary. What am I doing wrong?

Here's the output from 'gem env':

RubyGems Environment:
- RUBYGEMS VERSION: 1.3.5
- RUBY VERSION: 1.8.7 (2009-06-12 patchlevel 174) [universal-darwin10.0]
- INSTALLATION DIRECTORY: /.gem/ruby/1.8/gems
- RUBY EXECUTABLE: /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/bin/ruby
- EXECUTABLE DIRECTORY: /.gem/ruby/1.8/gems/bin
- RUBYGEMS PLATFORMS:
- ruby
- universal-darwin-10
- GEM PATHS:
- /.gem/ruby/1.8/gems
- /.gem/ruby/1.8
- /Library/Ruby/Gems/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
- REMOTE SOURCES:
- http://gems.rubyforge.org/

Addition: When I run gem update --system I get the following error:

Updating RubyGems  
Updating rubygems-update  
Successfully installed rubygems-update-1.8.5  
Updating RubyGems to 1.8.5  
Installing RubyGems 1.8.5  
ERROR:  While executing gem ... (Errno::EACCES)  
    Permission denied - /Library/Ruby/Site/1.8/gauntlet_rubygems.rb  
RubyGems system software update

It still reports running version 1.3.5

2

2 Answers

0
votes

Did you update your PATH to prefer your local gem 1.7.2 binary over the default? E.g. if you installed the 1.7.2 binary in ~/bin, you'd want to update your .bash_profile with export PATH="~/bin:$PATH".

Run which gem to find out which gem binary you are calling when you run gem env.

-1
votes

Can you install rvm on the server? If so then you can run inside your own app-specific rvm and have whatever gems/rubygems you want inside that.