?

Log in

No account? Create an account
entries friends calendar profile Previous Previous Next Next
Setting up system-wide RVM and Passenger on MacOS X - IBNeko's Journal-Nyo~!
ibneko
ibneko
Setting up system-wide RVM and Passenger on MacOS X
I wanted system-wide RVM. The idea of having RVM install different version of ruby into my home directory strikes me as a bit odd.

Anyways, I also ran into problems with getting Passenger to install - somewhere along the steps of getting RVM installed, then Ruby 1.9.1, I messed up the gem paths or used sudo when I shouldn't have used sudo. So I had problems running passenger-install-apache2-module. I kept getting the error:

/usr/lib/ruby/1.8/rubygems.rb:636:in `report_activate_error': Could not find RubyGem passenger (>= 0) (Gem::LoadError)
from /usr/lib/ruby/1.8/rubygems.rb:141:in `activate'
from /usr/lib/ruby/1.8/rubygems.rb:49:in `gem'
from /usr/bin/passenger-spawn-server:18

gem list said it was installed.
However, I discovered that Gem.path was terribly messed up and didn't match gem env at all. When running

$ ruby -r RubyGems -e "p Gem.path"

I got really strange path that had 1.9.1 in it, despite having 1.9.2 installed.

$ gem env
...
- GEM PATHS:
- /usr/local/rvm//gems/ruby-1.9.2-p0
- /usr/local/rvm//gems/ruby-1.9.2-p0@global
...


Anyways, in the end, I used a combination of:
http://rvm.beginrescueend.com/rvm/install/
+
http://rvm.beginrescueend.com/deployment/system-wide/

$ Sudo su
first, to get into a root shell, followed by
$ bash

Then I followed the normal installation steps - that installed rvm into /usr/local/rvm

Created /etc/rvmrc:
# Setup default configuration for rvm.
# If an rvm install exists in the home directory, don't load this.'
if [[ ! -s "\$HOME/.rvm/scripts/rvm" ]]; then
umask g+w
export rvm_selfcontained=0
export rvm_prefix="/usr/local/rvm"
export rvm_path="/usr/local/rvm"
fi

Added the following to /etc/profile:
# Load RVM if it is installed,
# first try to load user install
# then try to load root install,
# if user install is not there.
if [ -s "$HOME/.rvm/scripts/rvm" ] ; then
. "$HOME/.rvm/scripts/rvm"
elif [ -s "/usr/local/rvm/scripts/rvm" ] ; then
. "/usr/local/rvm/scripts/rvm"
fi

Added the following to ~/.profile
export rvm_path="/usr/local/rvm"
[[ -s "/usr/local/rvm/scripts/rvm" ]] && . "/usr/local/rvm/scripts/rvm" # This loads RVM into a shell session.
2 happy kittens | Leave catnip
Comments
From: (Anonymous) Date: January 8th, 2011 07:00 pm (UTC) (Link)

re:

waiting for next post
From: (Anonymous) Date: January 18th, 2011 12:08 am (UTC) (Link)

provides access

Very interesting blog post. Your blog is swiftly getting to be among my top picks.
2 happy kittens | Leave catnip