ERROR: Missing RVM environment file After Doing rvm upgrade command - Passenger 4.0.23

∥☆過路亽.° 提交于 2019-12-20 06:08:11

问题


I was running ruby 2.0.0-p247 on my Mac Mini Server (Mavericks 10.9.1). I read that there was a security vulnerability so I decided to upgrade to use the latest Ruby patch 2.0.0-p353. I did the following commands:

gem update --system (RubyGems 2.1.11)
rvm get stable (RVM 1.25.0)
rvm upgrade 2.0.0-p247 2.0.0-p353 (which should have moved my gemsets)

There is nothing in my system that I can find that references 2.0.0-p247 in rvm which is what I expected. When I go to ~/myuser/.rvm/environments there is no file 2.0.0-p247.

I am now attempting to start passenger. I had version 4.0.23 enterprise installed. I attempted to run rvmsudo passenger-install-apache2-module but got an error.

cd /Users/myuser/.rvm/gems/ruby-2.0.0-p353@mygemset/gems/passenger-enterprise-server-4.0.23
/Users/myuser/.rvm/wrappers/ruby-2.0.0-p353@ mygemset/rake apache2:clean apache2 RELEASE=yes
# /Users/myuser/.rvm/wrappers/ruby-2.0.0-p353@ mygemset/rake apache2:clean apache2 RELEASE=yes
ERROR: Missing RVM environment file: '/Users/myuser/.rvm/environments/ruby-2.0.0-p247@LightBeCorp_Rails4Ruby2'

Here are statements in my .bashrc file related to rvm if this will help.

[[ -s "$HOME/.rvm/scripts/rvm" ]]
PATH="$PATH:$HOME/.rvm/gems/ruby-1.9.3-p327@mygemset/bin:/.rvm/rubies/ruby-1.9.3-p327/bin/ruby:/.rvm/rubies/ruby-1.9.3-p448/bin/ruby:/.rvm/rubies/ruby-2.0.0-p353/bin/ruby:/usr/bin/psql:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"

I did a rvm list rubies command. ruby-2.0.0-p247 is not listed.

Any help would be appreciated. I will continue looking. I plan to post a link to this in the Phusion Passenger group.

UPDATE 12/21/2013 12:20 pm

I updated my .bashrc file to the following since I no longer use the other rubies in my Rails applications. I still get the error when I try to run rvmsudo passenger-install-apache2-module.

[[ -s "$HOME/.rvm/scripts/rvm" ]]
PATH="$PATH:$HOME/.rvm/rubies/ruby-2.0.0-p353/bin/ruby:/usr/bin/psql:/usr/local:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin"

回答1:


looks like a bug, please open a ticket here: https://github.com/wayneeseguin/rvm/issues


Indeed this was a bug, to fix it run:

rvm get head
rvm gemset reset_env

you can repeat the reset_env operation for every gemset that is broken:

rvm ruby@gemset do rvm gemset reset_env



回答2:


There might be a cached bin file in your RVM path. In my case, it's "/usr/local/rvm/bin/unicorn"

Also, you may not directly having the gem in your Gemfile. In my case, I do not have "unicorn" in my Gemfile although I had "capistrano-unicorn".

So that the system will try to use the global cached file "/usr/local/rvm/bin/unicorn".

The file's content may using a ruby that you no longer use.

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


来源:https://stackoverflow.com/questions/20704890/error-missing-rvm-environment-file-after-doing-rvm-upgrade-command-passenger

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!