Skip to content
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

Requiring Sequel triggers false warnings already initialized constant #2975

Closed
deepj opened this issue May 22, 2015 · 9 comments
Closed

Requiring Sequel triggers false warnings already initialized constant #2975

deepj opened this issue May 22, 2015 · 9 comments

Comments

@deepj
Copy link

@deepj deepj commented May 22, 2015

Used JRuby:

jruby 9.0.0.0.pre2 (2.2.2) 2015-04-28 2755ae0 Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]

The problem:

irb(main):001:0> require 'sequel'
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:3: warning: already initialized constant MAJOR
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:6: warning: already initialized constant MINOR
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:9: warning: already initialized constant TINY
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:12: warning: already initialized constant VERSION
=> true

How to reproduce:

$ gem install sequel
Successfully installed sequel-4.22.0
1 gem installed
$ irb
irb(main):001:0> require 'sequel'
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:3: warning: already initialized constant MAJOR
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:6: warning: already initialized constant MINOR
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:9: warning: already initialized constant TINY
/Users/deepj/.gem/jruby/2.2.2/gems/sequel-4.22.0/lib/sequel/version.rb:12: warning: already initialized constant VERSION
=> true
@kares
Copy link
Member

@kares kares commented May 24, 2015

could you mention the JRuby version used, please.
before 1.7.20 ... other versions have had issues double loading stuff on occasion due path expansion.

@deepj
Copy link
Author

@deepj deepj commented May 24, 2015

Ticket updated

@headius
Copy link
Member

@headius headius commented May 26, 2015

Sigh, seems like there may still be some double-loading issues.

@headius
Copy link
Member

@headius headius commented May 26, 2015

@deepj I could not reproduce on master. Can you try a jruby-head build and see if it fixes the problem for you?

If you still see the issue, gist the result of running with -Xdebug.loadService=true to show the load searching in action.

@deepj
Copy link
Author

@deepj deepj commented May 26, 2015

ruby -v
jruby 9.0.0.0-SNAPSHOT (2.2.2) 2015-05-26 ce40bac Java HotSpot(TM) 64-Bit Server VM 25.45-b02 on 1.8.0_45-b14 +jit [darwin-x86_64]
$ irb
irb(main):001:0> require 'sequel'
=> true

In this version it is gone. I'm closing it now.

@deepj deepj closed this May 26, 2015
@headius
Copy link
Member

@headius headius commented May 26, 2015

Thanks!

@headius headius added this to the JRuby 9.0.0.0.rc1 milestone May 26, 2015
@bilus
Copy link

@bilus bilus commented Feb 12, 2016

Oddly enough, I'm getting these errors in RSpec specs with Ruby '2.3'

@headius
Copy link
Member

@headius headius commented Feb 14, 2016

@bilus You're getting the Sequel errors under CRuby 2.3?

@bilus
Copy link

@bilus bilus commented Feb 15, 2016

Yes, MRI. And only when running specs which, on the whole, is odd. I also made sure Sequel is included only once ever.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants