Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generated environment file missing some variables #2543

Closed
mhale opened this issue Jan 14, 2014 · 2 comments
Closed

Generated environment file missing some variables #2543

mhale opened this issue Jan 14, 2014 · 2 comments
Milestone

Comments

@mhale
Copy link

mhale commented Jan 14, 2014

I have been having an issue with Passenger not loading the gemset correctly for Rails applications in RVM 1.25.x. This occurs because I am using a config/setup_load_paths.rb file as recommended here:

https://rvm.io/deployment/passenger3

The MY_RUBY_HOME variable is not being set in the environment file, so RVM never switches to the correct gemset. In my case, it was missing from:

/usr/local/rvm/rubies/ruby-2.0.0-p353/lib/ruby/gems/2.0.0/environment

The content of that file looked like this after I did "rvm install ruby-2.0.0-p353":

export PATH="/usr/local/rvm/gems/ruby-2.0.0-p353@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p353/bin:$PATH"
export GEM_HOME='/usr/local/rvm/gems/ruby-2.0.0-p353@global'
export GEM_PATH='/usr/local/rvm/gems/ruby-2.0.0-p353@global'
export IRBRC='/usr/local/rvm/rubies/ruby-2.0.0-p353/.irbrc'
unset MAGLEV_HOME
unset RBXOPT

Adding MY_RUBY_HOME with the correct value and restarting Passenger fixes the issue. This issue occurs in every version of 1.25.x that I've used, so I don't know when it was introduced. I can confirm that it happens in 1.25.14 (latest release) and is reproducible.

The output of rvm info is:

ruby-2.0.0-p353@global:

system:
  uname:       "Linux webdirect1 3.8.0-29-generic #42~precise1-Ubuntu SMP Wed Aug 14 16:19:23 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux"
  system:      "ubuntu/12.04/x86_64"
  bash:        "/bin/bash => GNU bash, version 4.2.25(1)-release (x86_64-pc-linux-gnu)"
  zsh:         " => not installed"

rvm:
  version:      "rvm 1.25.14 (stable) by Wayne E. Seguin <wayneeseguin@gmail.com>, Michal Papis <mpapis@gmail.com> [https://rvm.io/]"
  updated:      "3 days 20 hours 46 minutes 16 seconds ago"
  path:         "/usr/local/rvm"

ruby:
  interpreter:  "ruby"
  version:      "2.0.0p353"
  date:         "2013-11-22"
  platform:     "x86_64-linux"
  patchlevel:   "2013-11-22 revision 43784"
  full_version: "ruby 2.0.0p353 (2013-11-22 revision 43784) [x86_64-linux]"

homes:
  gem:          "/usr/local/rvm/gems/ruby-2.0.0-p353@global"
  ruby:         "/usr/local/rvm/rubies/ruby-2.0.0-p353"

binaries:
  ruby:         "/usr/local/rvm/rubies/ruby-2.0.0-p353/bin/ruby"
  irb:          "/usr/local/rvm/rubies/ruby-2.0.0-p353/bin/irb"
  gem:          "/usr/local/rvm/rubies/ruby-2.0.0-p353/bin/gem"
  rake:         "/usr/local/rvm/rubies/ruby-2.0.0-p353/bin/rake"

environment:
  PATH:         "/usr/local/rvm/gems/ruby-2.0.0-p353@global/bin:/usr/local/rvm/rubies/ruby-2.0.0-p353/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/rvm/bin"
  GEM_HOME:     "/usr/local/rvm/gems/ruby-2.0.0-p353@global"
  GEM_PATH:     "/usr/local/rvm/gems/ruby-2.0.0-p353@global"
  MY_RUBY_HOME: "/usr/local/rvm/rubies/ruby-2.0.0-p353"
  IRBRC:        "/usr/local/rvm/rubies/ruby-2.0.0-p353/.irbrc"
  RUBYOPT:      ""
  gemset:       "global"

Btw, I backed the RVM 2.0 Bountysource fundraiser, congratulations on completing it.

@mpapis mpapis closed this as completed in f86dce9 Jan 14, 2014
@mpapis
Copy link
Member

mpapis commented Jan 14, 2014

ah sorry, I thought we did not needed those, the above commit restores it, you can:

rvm get head         # update rvm
rvm gemset reset_env # fix the environment file (and wrappers)

@mhale
Copy link
Author

mhale commented Jan 14, 2014

Brilliant, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants