Load rubygems before changing Encoding.default_internal (fixes #1914)

git-svn-id: file:///home/svn/framework3/trunk@9359 4d416f70-5f16-0410-b530-b9f4589650da
unstable
Mike Smith 2010-05-24 23:07:56 +00:00
parent d90656be0e
commit 8b9eb25664
1 changed files with 5 additions and 0 deletions

View File

@ -29,6 +29,11 @@ if (RUBY_VERSION =~ /^1\.9\.0/)
end
if(RUBY_VERSION =~ /^1\.9\./)
# Load rubygems before changing default_internal, otherwise we may get
# Encoding::UndefinedConversionError as the gemspec files are loaded
require 'rubygems'
Gem::Version # trigger Rubygems to fully load
# Force binary encoding for Ruby versions that support it
if(Object.const_defined?('Encoding') and Encoding.respond_to?('default_external='))
Encoding.default_external = Encoding.default_internal = "binary"