Which GEM_HOME and GEM_PATH is passenger using?

1,555 views
Skip to first unread message

Gitted

unread,
Dec 5, 2010, 11:28:19 AM12/5/10
to Phusion Passenger Discussions
How can I find out what GEM_HOME and GEM_PATH passenger is using?

I am seeing a uninitialized constant Bundler in my boot.rb file, but
things seem to work fine when I do a 'rails console production' on my
live server. i.e. I can require 'bundler' and do a 'Bunder.setup'.


I am guessing the GEM_HOME and GEM_PATH might be incorrect.

Gitted

unread,
Dec 5, 2010, 11:29:22 AM12/5/10
to Phusion Passenger Discussions
Where can I explicitly set GEM_HOME and GEM_PATH?

I am running ubuntu, nginx, passenger, ree, rvm for a rails 3 app.

Hongli Lai

unread,
Dec 5, 2010, 12:54:22 PM12/5/10
to phusion-...@googlegroups.com
On Sun, Dec 5, 2010 at 5:28 PM, Gitted <sahme...@gmail.com> wrote:
> How can I find out what GEM_HOME and GEM_PATH passenger is using?

It uses whatever environment variable your web server starts with. How
your web server gets your environment variable depends on your system.
However you can customize environment variables according to the
instructions at
http://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ruby-from-phusion-passenger/

--
Phusion | The Computer Science Company

Web: http://www.phusion.nl/
E-mail: in...@phusion.nl
Chamber of commerce no: 08173483 (The Netherlands)

Gitted

unread,
Dec 5, 2010, 4:13:32 PM12/5/10
to Phusion Passenger Discussions
Hi,

So my nginx.conf is pointing to this wrapper (I installed nginx using
the phusion installer):

/opt/nginx/confg/nginx.conf

http {

passenger_root /usr/local/rvm/gems/ree-1.8.7-2010.02/gems/
passenger-3.0.0;
passenger_ruby /usr/local/rvm/wrappers/ree-1.8.7-2010.02/ruby

}

So from what I understand from the blog post, I should add the export
statements to the wrapper correct, i.e in the file

/usr/local/rvm/wrappers/ree-1.8.7-2010.02/ruby which contains:

#!/usr/bin/env bash

if [[ -s "/usr/local/rvm/environments/ree-1.8.7-2010.02" ]] ; then
source "/usr/local/rvm/environments/ree-1.8.7-2010.02"
exec ruby "$@"
else
echo "ERROR: Missing RVM environment file: '/usr/local/rvm/
environments/ree-1.8.7-2010.02'" >&2
exit 1
fi


My web application is suppose to run ree@rails3 (ruby + gemset)

When I go to /current which has my .rvmrc and do a rvm info I get:

GEM_HOME: "/usr/local/rvm/gems/ree-1.8.7-2010.02@rails3"
GEM_PATH: "/usr/local/rvm/gems/ree-1.8.7-2010.02@rails3:/usr/
local/rvm/gems/ree-1.8.7-2010.02@global"

Is this what I should add to the wrapper script? If yes, where
exactly right at the top?










On Dec 5, 12:54 pm, Hongli Lai <hon...@phusion.nl> wrote:
> On Sun, Dec 5, 2010 at 5:28 PM, Gitted <sahmed1...@gmail.com> wrote:
> > How can I find out what GEM_HOME and GEM_PATH passenger is using?
>
> It uses whatever environment variable your web server starts with. How
> your web server gets your environment variable depends on your system.
> However you can customize environment variables according to the
> instructions athttp://blog.phusion.nl/2008/12/16/passing-environment-variables-to-ru...
>
> --
> Phusion | The Computer Science Company
>
> Web:http://www.phusion.nl/
> E-mail: i...@phusion.nl
Reply all
Reply to author
Forward
0 new messages