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

Gem::LoadError: can't activate jruby-openssl-0.9.6-java, already activated jruby-openssl-0.9.5-java #2444

Closed
Allanon29 opened this issue Jan 9, 2015 · 8 comments

Comments

@Allanon29
Copy link

Hi Guys,

I get the following error when I try to deploy a Rails 4.1.8 app on a Centos 6 VPS:

** [out :: IP] Gem::LoadError: can't activate jruby-openssl-0.9.6-java, already activated jruby-openssl-0.9.5-java ** [out :: IP] raise_if_conflicts at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:1988 ** [out :: IP] activate at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/specification.rb:1238 ** [out :: IP] gem at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_gem.rb:48 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:46 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/security.rb:11 ** [out :: IP] require at org/jruby/RubyKernel.java:1065 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/package.rb:1 ** [out :: IP] require at org/jruby/RubyKernel.java:1065 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/package.rb:43 ** [out :: IP] require at org/jruby/RubyKernel.java:1065 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 ** [out :: IP] require at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/dependency_installer.rb:1 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/shared/rubygems/dependency_installer.rb:4 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/installer.rb:1 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/installer.rb:2 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/cli/install.rb:1 ** [out :: IP] run at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/cli/install.rb:79 ** [out :: IP] install at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/cli.rb:145 ** [out :: IP] run at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/vendor/thor/command.rb:27 ** [out :: IP] invoke_command at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/vendor/thor/invocation.rb:121 ** [out :: IP] dispatch at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/vendor/thor.rb:363 ** [out :: IP] start at /home/user/.rbenv/versions/jruby-1.7.16/lib/ruby/gems/shared/gems/bundler-1.7.11/lib/bundler/vendor/thor/base.rb:440 ** [out :: IP] load at org/jruby/RubyKernel.java:1081 ** [out :: IP] (root) at /home/user/.rbenv/versions/jruby-1.7.16/bin/bundle:23 command finished in 10235ms *** [deploy:update_code] rolling back

Tried with jruby-1.7.15, jruby-1.7.18 and the same thing happens.
The error comes up when capistrano tries to run “bundle install” in the release path.
I do no have jruby-openssl in my Gemfile (and it is not inside my Gemfile.lock either), since as far as I know it is not required.

Any idea why this happens and especially how to solve this?

@mkristian
Copy link
Member

jruby-1.7.x comes with jruby-openssl-0.9.5 included. since a couple of weeks there is a jruby-openssl-0.9.6 gem on rubygems.org

from what you describe it is not clear where the newer version comes into picture.

you could try adding jruby-openssl-0.9.5 to your Gemfile, even if it is not strictly needed.

@Allanon29
Copy link
Author

Hi Kristian,

Thanks for the quick reply. I've already tried to add jruby-openssl 0.9.5 to my Gemfile, but it didn't work.
However installing 1.7.9 solved the problem, but this is far from ideal.

"from what you describe it is not clear where the newer version comes into picture."
I don't know this either. First I thought that maybe another app installed on the server causes it which had jruby openssl in its gemfile but since then I removed it, reinstalled rbenv, jruby, and torquebox, but the same error appeared again.

@headius
Copy link
Member

headius commented Jan 12, 2015

Check your gem dependencies (I believe there's a bundler flag to show the whole tree) and look for that jruby-openssl instance. It definitely sounds like it's getting pulled in as a transitive dependency of some kind.

@michaelachrisco
Copy link

I am having the same issue:

Gem::LoadError: can't activate jruby-openssl-0.9.6-java, already activated jruby-openssl-0.9.5-java
 raise_if_conflicts at /usr/local/rvm/rubies/jruby-1.7.16.1/lib/ruby/shared/rubygems/specification.rb:1988
            activate at /usr/local/rvm/rubies/jruby-1.7.16.1/lib/ruby/shared/rubygems/specification.rb:1238
                 gem at /usr/local/rvm/rubies/jruby-1.7.16.1/lib/ruby/shared/rubygems/core_ext/kernel_gem.rb:48
             require at /usr/local/rvm/rubies/jruby-1.7.16.1/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:46
              (root) at /usr/local/rvm/rubies/jruby-1.7.16.1/lib/ruby/shared/rubygems/security.rb:11
             require at org/jruby/RubyKernel.java:1065
#Gemfile
source 'https://rubygems.org'

gem 'rails', '4.1.5'

gem 'awesome_print'
# gem 'activerecord-jdbc-adapter'
gem 'activerecord-jdbcmysql-adapter'
gem 'devise'
gem 'doorkeeper', :github => 'doorkeeper-gem/doorkeeper'
# gem 'figaro'
gem 'jdbc-mysql', :platform => :jruby
gem 'jquery-rails'
gem 'jruby-openssl', '0.9.5'
gem 'mysql2', :platform => :ruby
gem 'plissken', '0.2.0'
gem 'puma'
gem 'seedbank'
gem 'symbolize'
gem 'therubyrhino'
gem 'uglifier', '>= 1.0.3'

group :development, :test do
  gem 'ar-octopus'
  gem 'capistrano', '~> 3.3.0'
  gem 'capistrano-rails', :require => false
  gem 'capistrano-bundler', :require => false
  gem 'capistrano-rvm'
  gem 'capistrano3-puma'
  gem 'capybara'
  gem 'coveralls', :require => false
  gem 'factory_girl_rails'
  gem 'faker'
  gem 'hound-tools', '~> 0.0.6',
      :github => 'michaelachrisco/hound-tools',
      :require => false
  gem 'json_spec'
  gem 'omniauth'
  gem 'omniauth-oauth2', '1.0.3'
  gem 'pry'
  gem 'figaro'
  gem 'rspec-its'
  gem 'rspec-rails', '~> 3.0'
  gem 'rubocop', '0.28.0', :require => false
  # install manually for your environment
  # gem 'vagrant', :require => false
end

I am using vagrant to create a vm from scratch, then using cap development deploy on the vm. The bundle that capistrano is using:

cd /home/gman/www/releases/20150203193233 && /usr/local/rvm/bin/rvm default do bundle install --path /home/gman/www/shared/bundle --without development test --deployment --quiet

@michaelachrisco
Copy link

Here is the output for gem dependency:

$ gem dependency 

Gem jruby-openssl-0.9.5-java

Gem jruby-openssl-0.9.6-java
  jar-dependencies (= 0.0.9, development)
  mocha (~> 1.1.0, development)

@michaelachrisco
Copy link

Looks like sudo gem install jruby-openssl resolves the issue.

@mkristian
Copy link
Member

yes, gem install jruby-openssl does tell jruby to use the installed
jruby-openssl instead of the one which comes with jruby itself.

but thanx for the Gemfile maybe it helps to reproduce this somehow.

@kares
Copy link
Member

kares commented May 23, 2017

has been an issue with RubyGems (due default gems) ... however latest 1.7.x should be good

@kares kares closed this as completed May 23, 2017
@enebo enebo added this to the JRuby 1.7.27 milestone May 25, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants