-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
2.5.1 warnings #84
Comments
Looks like it may have to do with this line in ses.rb:
Could you verify that? |
I commented that line out and it squelched the warnings for me. Haven't done a significant test of the codebase, though my code accessing S3 appears to have succeeded just fine... Would be nice to get that patched into a gem release. |
To get rid of warnings in a 2.3.4 Rails app that uses MRI 1.8.7, I added the following to config/preinitializer.rb: # This is a different implementation of require_relative than the one
# supplied in the aws-2.5.6 codebase. Theirs causes duplicate
# requires and the consequent "already initialized constant" warnings.
# see vendor/ruby/1.8/gems/aws-2.5.6/lib/awsbase/require_relative.rb
# and https://github.com/appoxy/aws/issues/84
unless Kernel.respond_to?(:require_relative)
module Kernel
def require_relative(path)
desired_path = File.expand_path('../' + path.to_str, caller[0])
shortest = desired_path
$:.each do |path|
path += '/'
if desired_path.index(path) == 0
candidate = desired_path.sub(path, '')
shortest = candidate if candidate.size < shortest.size
end
end
require shortest
end
end
end It seems to work for me. |
@ctm Thanks for the fix. |
Hi,
i'm getting a couple of warning on Ruby 1.8 (Fedora 14):
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/utils.rb:105: warning: already initialized constant HEX
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/utils.rb:107: warning: already initialized constant TO_REMEMBER
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/utils.rb:108: warning: already initialized constant ASCII
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/errors.rb:128: warning: already initialized constant DEFAULT_CLOSE_ON_4XX_PROBABILITY
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/parsers.rb:47: warning: already initialized constant DEFAULT_XML_LIBRARY
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/awsbase.rb:66: warning: already initialized constant AMAZON_PROBLEMS
/usr/lib/ruby/gems/1.8/gems/aws-2.5.1/lib/ses/../awsbase/awsbase.rb:86: warning: already initialized constant DEFAULT_SIGNATURE_VERSION
-- Michal
The text was updated successfully, but these errors were encountered: