def self.ruby_command
if in_rvm?
name = rvm_ruby_string
dir = rvm_path
if name && dir
filename = "#{dir}/wrappers/#{name}/ruby"
if File.exist?(filename)
contents = File.open(filename, 'rb') do |f|
f.read
end
if contents.include?("$HOME")
filename = nil
end
else
filename = nil
end
if filename
return filename
else
STDERR.puts "Your RVM wrapper scripts are too old. Please " +
"update them first by running 'rvm get head && " +
"rvm reload && rvm repair all'."
exit 1
end
else
STDERR.puts "Your RVM installation appears to be broken: the RVM " +
"path cannot be found. Please fix your RVM installation " +
"or contact the RVM developers for support."
exit 1
end
else
return ruby_executable
end
end