views:

370

answers:

2

I am actually running phusion passenger on ubuntu for a while. today i updated Ruby Enterprise Edition to the latest version - now it seems i have to reinstall all the gems that were installed on the system. so here are my questions

  • what is the best way to setup phusion passenger and ruby enterprise edition to easily maintain gems afterwards, even if a new Ruby Enterprise Edition gets released?
  • should gems be installed from the root user or from a system user (user .gem directory) - what would be the best practice here?
A: 

i now did the following to make maintainability more easy on my system (any comments welcome, as i am not sure if that is the best practice)

  • uninstall all gems as the root user: gem list --no-versions | xargs gem uninstall -a -I
  • install passenger as root user (via /opt/REE/bin/gem install passenger ) - i also had to install 'rake'
  • made a symlink from /opt/REE to the latest ruby enterprise version dir
  • run /opt/REE/bin/passenger-install-apache2-module as the root user
  • added the loadmodule directives to /etc/apache2/apache2.conf
  • create a user phusion passenger runs under and change his path to 1) ruby system binary directory 2) user specific gem binary directory

    PATH=$PATH:/home//.gem/ruby/1.8/bin:/opt/ruby-enterprise-1.8.7-2010.01/bin

(i changed that settings in .bash_profile and switch to the user with su username -l ) most of the gems i maintain now within the packages (frozen). except rails, which is installed on the system.

is there anoter (better) way? how are other people doing this kind of system maintainance?

z3cko
ok, i think i have the answer now (at least that is how it works for me) see also http://reborg.tumblr.com/post/99668398/rails-gems-unpack-native for more information. freezing rails, unpacking the gems to the vendor dir and just having the basic gems online works. with basic gems i mean rack, passenger, fastthread and rake (+db gems if you prefer). the rest comes with the app and gets compiled on deploy time, if needed via rake gems:install.
z3cko
A: 

I wonder if you could use GEM_HOME like jruby does? I haven't tried it but it seems that it would be elegant.

joshsz