ERROR: Missing RVM environment file After Doing rv

2019-03-05 01:20发布

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"

2条回答
别忘想泡老子
2楼-- · 2019-03-05 02:09

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
查看更多
ゆ 、 Hurt°
3楼-- · 2019-03-05 02:18

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
查看更多
登录 后发表回答