ruby - Capistrano deployment error Can't activate jruby-openssl-0.9.5-java -
i have developed new rails (4.1.4) app in jruby (1.7.10) , trying deploy capistrano v3 on remote vps. error getting looks like:
info[551a80fb] running ~/.rvm/bin/rvm default bundle install --binstubs /home/deployer/apps/appname/shared/bin --path /home/deployer/apps/appname/shared/bundle --without development test on example.net debug[551a80fb] command: cd /home/deployer/apps/appname/releases/20140919052426 && ~/.rvm/bin/rvm default bundle install --binstubs /home/deployer/apps/appname/shared/bin --path /home/deployer/apps/appname/shared/bundle --without development test debug[551a80fb] gem::loaderror: can't activate jruby-openssl-0.9.5-java, activated jruby-openssl-0.9.3 debug[551a80fb] debug[551a80fb] raise_if_conflicts @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/specification.rb:1988 debug[551a80fb] debug[551a80fb] activate @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/specification.rb:1238 debug[551a80fb] debug[551a80fb] gem @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_gem.rb:48 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:46 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/security.rb:11 debug[551a80fb] debug[551a80fb] require @ org/jruby/rubykernel.java:1083 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/package.rb:1 debug[551a80fb] debug[551a80fb] require @ org/jruby/rubykernel.java:1083 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/package.rb:43 debug[551a80fb] debug[551a80fb] require @ org/jruby/rubykernel.java:1083 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:55 debug[551a80fb] debug[551a80fb] require @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/core_ext/kernel_require.rb:53 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/dependency_installer.rb:1 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/rubies/jruby-1.7.10/lib/ruby/shared/rubygems/dependency_installer.rb:4 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundl debug[551a80fb] er-1.7.3/lib/bundler/installer.rb:1 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/installer.rb:2 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/cli/install.rb:1 debug[551a80fb] run @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/cli/install.rb:78 debug[551a80fb] debug[551a80fb] install @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/cli.rb:145 debug[551a80fb] debug[551a80fb] run @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/vendor/thor/command.rb:27 debug[551a80fb] debug[551a80fb] invoke_command @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/vendor/thor/invocation.rb:121 debug[551a80fb] debug[551a80fb] dispatch @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/vendor/thor.rb:363 debug[551a80fb] debug[551a80fb] start @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/vendor/thor/base.rb:440 debug[551a80fb] debug[551a80fb] load @ org/jruby/rubykernel.java:1099 debug[551a80fb] debug[551a80fb] start @ /home/deployer/.rvm/gems/jruby-1.7.10@global/gems/bundler-1.7.3/lib/bundler/cli.rb:9 debug[551a80fb] debug[551a80fb] eval @ org/jruby/rubykernel.java:1119 debug[551a80fb] debug[551a80fb] (root) @ /home/deployer/.rvm/gems/jruby-1.7.10@global/bin/jruby_executable_hooks:15
this how gemfile looks like:
source 'https://rubygems.org' ruby '1.9.3', :engine => 'jruby', :engine_version => '1.7.10' gem 'bouncy-castle-java', '<= 1.50' # attempt fix version of jruby-openssl gem 'jruby-openssl', '0.9.5' # 0.9.5. tried 0.9.3 no effect. gem 'rails', '4.1.4' gem 'sass-rails', '~> 4.0.3' gem 'uglifier', '>= 1.3.0' gem 'therubyrhino' gem 'jquery-rails' gem 'jbuilder', '~> 2.0' gem 'sdoc', '~> 0.4.0', group: :doc gem 'activerecord-jdbcmysql-adapter' gem 'devise' gem 'devise_invitable', :github => 'scambra/devise_invitable' gem "paperclip" gem 'acts_as_list' gem 'pry-rails', group: :development gem 'rubyzip' gem 'to_bool', '~> 1.0.1' gem "jquery-fileupload-rails" # use capistrano deployment gem 'capistrano', group: :development gem 'capistrano-rvm', group: :development gem 'capistrano-bundler', group: :development gem 'capistrano-rails', group: :development gem 'trinidad', require: false gem 'trinidad_init_services', require: false gem 'rvm1-capistrano3', require: false
capfile:
require 'capistrano/setup' require 'capistrano/deploy' require 'capistrano/rvm' require 'capistrano/bundler' require 'capistrano/rails' require 'capistrano/rails/assets' require 'capistrano/rails/migrations' require 'rvm1/capistrano3' dir.glob('lib/capistrano/tasks/*.rake').each { |r| import r }
deploy.rb:
# config valid capistrano 3.1 lock '3.2.1' set :bundle_flags, '--deployment' # tried removing switch deployment if installing system gem helps set :deploy_user, "deployer" set :application, 'appname' set :repo_url, 'git@bitbucket.org:user/repo.git' server "example.net", user: 'deployer', roles: [:web, :app, :db] set :rvm_type, :user set :rvm1_ruby_version, 'jruby-1.7.10' set :scm, :git set :pty, true set :deploy_to, "/home/#{fetch(:deploy_user)}/apps/#{fetch(:application)}" set :linked_files, %w{config/database.yml} set :linked_dirs, %w{bin log tmp/pids tmp/cache tmp/sockets vendor/bundle public/system} set :keep_releases, 5 after "deploy", "deploy:cleanup" namespace :deploy desc 'restart application' task :restart on roles(:app), in: :sequence, wait: 5 execute :touch, release_path.join('tmp/restart.txt') end end after :publishing, :restart after :restart, :clear_cache on roles(:web), in: :groups, limit: 3, wait: 10 # here can such as: # within release_path execute :rake, 'cache:clear' # end end end desc 'delete shared bundle folder' task :remove_shared_bundle on roles(:app), in: :sequence, wait: 5 execute :rm, "-fr", "#{shared_path}/bundle" end end before :starting, :remove_shared_bundle end def template(from, to) erb = file.read(file.expand_path("../config/recipes/templates/#{from}", file.dirname(__file__))) # file.join(file.expand_path(file.dirname(__file__)), 'poi') # put erb.new(erb).result(binding), upload! stringio.new(erb.new(erb).result(binding)), end namespace :deploy desc "install onto server" task :install on roles(:all), in: :sequence, wait: 1 execute 'mkdir', '-p', fetch(:deploy_to) execute :sudo, 'apt-get', '-y', "update" execute :sudo, 'apt-get', '-y', "install", "build-essential zlib1g-dev libssl-dev libreadline-gplv2-dev python-software-properties curl git-core openjdk-7-jdk jsvc" end end end
it seems root of error thor gem. if remove bundle folder inside shared directory installs gems. fails next time onwards. 'remove_shared_bundle' task tried delete bundle folder before before each deploy worked. fresh installation every time time taking.
is there remedy issue?
i think issue might related jruby's default gems being unchangeable in 1.7.10 ... has been fixed since, immediate thing try jruby 1.7.15 (or @ least 1.7.13)
i not declare gem 'jruby-openssl', '0.9.5'
in gemfile (remove completely) let jruby use whatever has available - wonder if there gem pulling in, (if there's no gem pulling bundle dependency) resolve under 1.7.10.
Comments
Post a Comment