# File lib/rubygems/source_index.rb, line 83
    def load_specification(file_name)
      begin
        spec_code = if RUBY_VERSION < '1.9' then
                      File.read file_name
                    else
                      File.read file_name, :encoding => 'UTF-8'
                    end.untaint

        gemspec = eval spec_code, binding, file_name

        if gemspec.is_a?(Gem::Specification)
          gemspec.loaded_from = file_name
          return gemspec
        end
        alert_warning "File '#{file_name}' does not evaluate to a gem specification"
      rescue SignalException, SystemExit
        raise
      rescue SyntaxError => e
        alert_warning e
        alert_warning spec_code
      rescue Exception => e
        alert_warning "#{e.inspect}\n#{spec_code}"
        alert_warning "Invalid .gemspec format in '#{file_name}'"
      end
      return nil
    end