def self.rvm_paths
if in_rvm?
result = []
[ENV['rvm_path'], "~/.rvm", "/usr/local/rvm"].each do |path|
next if path.nil?
path = File.expand_path(path)
rubies_path = File.join(path, 'rubies')
wrappers_path = File.join(path, 'wrappers')
gems_path = File.join(path, 'gems')
if File.directory?(path) && (File.directory?(rubies_path) ||
File.directory?(wrappers_path) || File.directory?(gems_path))
result << path
end
end
if result.empty?
STDERR.puts "Unable to locate the RVM path. Your RVM installation " +
"is probably too old. Please update it with " +
"'rvm get head && rvm reload && rvm repair all'."
exit 1
else
return result
end
else
return nil
end
end