13

When running my rails application on torquebox, I get a lot of

already initialized constant: ...

warnings that originate from gems/jruby-openssl-0.8.2/lib/shared/jruby-openssl.rb:16. Is this a security problem? Is there any way to get rid of these warnings?

panmari
  • 3,627
  • 3
  • 28
  • 48
  • 1
    having same warnings too – Çağdaş Jan 25 '13 at 08:09
  • I'm trying to figure this out and can't even find the code to see what's on the offending line. My guess is this is packaged with JRuby itself and needs to be issued to teh JRuby group on CodeHaus.org? Still looking... – Jeff Ancel Jan 28 '13 at 16:31

2 Answers2

14

I could finally get rid of it by removing the gem altogether. According to this source, jruby-openssl is now directly pulled into the jruby project and is not needed anymore as gem.

Thanks everyone for looking into this with me.

panmari
  • 3,627
  • 3
  • 28
  • 48
7

I am no longer getting these errors after adding the following to my line in Gemfile.

gem 'jruby-openssl', :require => false

I hope this helps out.

Jeff Ancel
  • 3,076
  • 3
  • 32
  • 39
  • From reading around on the comments, seems that this is only necessary to be available. Adding the require => false seemed logical, after I read somewhere that this is really a workaround for the way in which jruby library has packaged openssl (according to some posts on Jruby site. – Jeff Ancel Jan 28 '13 at 17:09
  • this works for me too. but wanna know whats happening really :) – Çağdaş Jan 29 '13 at 07:47
  • 1
    Can you please add a source where you found this information? I'd like to read a bit further before I apply your fix. – panmari Jan 29 '13 at 10:27
  • 1
    The resource I saw, which I can't find anymore, was in a reference to when I was really just trying to find out why there is no code in the jruby-ossl library, and it's because it's been included in jruby core. The way that jruby-core loads openssl (which I believe is where the issue really is), is what makes you need to put this gem in your Gemfile at all (try to find the source for the Gem). So putting require => false makes code available if needed. – Jeff Ancel Jan 29 '13 at 12:47
  • Perhaps removing the gem completely will expose the error. I haven't tried this step, but if you do that and have the error, and search on it, you may find it. I consider this a JRUBY workaround, as their integration with obenssl is somewhat vague as there is no source in this gem (at least on github currently). Previous versions, sure. – Jeff Ancel Jan 29 '13 at 12:50
  • still having these warning in production :/ – Çağdaş Feb 06 '13 at 13:02
  • I am seeing the issue as well when using versions of jruby/jruby-jars < 1.7.2 (I haven't tried 1.7.1, or removing the :require => false on 1.7.0) This may have something to do with the warnings. – Jeff Ancel Feb 07 '13 at 16:10