# File lib/rvm/environment/utility.rb, line 13 def self.current_environment_id @current_environment_id ||= begin gem_home = ENV['GEM_HOME'].to_s.strip if !gem_home.empty? && gem_home =~ /rvm\/gems\// File.basename(gem_home) else matching_path = $:.select { |item| item =~ /rvm\/rubies/ }.first matching_path.to_s.gsub(/^.*rvm\/rubies\//, '').split('/')[0] || "system" end end end