Is there a way to determine what version of Ruby is running from within Rails (either on the web or through script/console)? I have Ruby 1.8.6 installed but I\'
Use RUBY_VERSION as mentioned by others.
You can then use Gem::Version to do version string comparison:
require 'rubygems' # Only needed for ruby pre-1.9.0 but it's safe for later versions (evaluates to false).
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('1.9.0')
extend DL::Importable
else
extend DL::Importer
end