arton / rjb

Ruby Java Bridge
https://www.artonx.org/collabo/backyard/?RubyJavaBridge
GNU Lesser General Public License v2.1
117 stars 34 forks source link

An error occurred while installing rjb (1.4.9), and Bundler cannot continue. ( Ruby 3.2.4) #111

Closed Blackbaud-SachinDhiman closed 4 months ago

Blackbaud-SachinDhiman commented 4 months ago

An error occurred while installing rjb (1.4.9), and Bundler cannot continue.

In Gemfile: soapui-util was resolved to 0.47.0, which depends on rjb

Detail Error Description: Installing rjb 1.4.9 with native extensions Gem::Ext::BuildError: ERROR: Failed to build gem native extension.

current directory: /home/sachindhiman/.rvm/gems/ruby-3.2.4@saboten-mock-worker-qa/gems/rjb-1.4.9/ext        

/home/sachindhiman/.rvm/rubies/ruby-3.2.4/bin/ruby extconf.rb extconf.rb failed Could not create Makefile due to some reason, probably lack of necessary libraries and/or headers. Check the mkmf.log file for more details. You may need configuration options.

Provided configuration options: --with-opt-dir --without-opt-dir --with-opt-include --without-opt-include=${opt-dir}/include --with-opt-lib --without-opt-lib=${opt-dir}/lib --with-make-prog --without-make-prog --srcdir=. --curdir --ruby=/home/sachindhiman/.rvm/rubies/ruby-3.2.4/bin/$(RUBY_BASE_NAME) extconf.rb:42:in <main>': undefined methodexists?' for File:Class (NoMethodError)

if !File.exists?(inc) && RUBY_PLATFORM =~ /darwin/ ^^^^^^^^ Did you mean? exist?

extconf failed, exit code 1

Gem files will remain installed in /home/sachindhiman/.rvm/gems/ruby-3.2.4@saboten-mock-worker-qa/gems/rjb-1.4.9 for inspection. Results logged to /home/sachindhiman/.rvm/gems/ruby-3.2.4@saboten-mock-worker-qa/extensions/x86_64-linux/3.2.0/rjb-1.4.9/gem_make.out

/home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/ext/builder.rb:119:in run' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/ext/ext_conf_builder.rb:28:inbuild'
/home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/ext/builder.rb:187:in build_extension' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/ext/builder.rb:221:inblock in build_extensions' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:in each' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/ext/builder.rb:218:inbuild_extensions'
/home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/rubygems/installer.rb:846:in build_extensions' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/rubygems_gem_installer.rb:72:in build_extensions' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/rubygems_gem_installer.rb:28:in install' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/source/rubygems.rb:202:ininstall' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/installer/gem_installer.rb:54:in install' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/installer/gem_installer.rb:16:in install_from_spec' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/installer/parallel_installer.rb:156:in do_install' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/installer/parallel_installer.rb:147:inblock
in worker_pool' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/worker.rb:62:in apply_func' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/worker.rb:57:inblock in process_queue'
/home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/worker.rb:54:in loop' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/worker.rb:54:inprocess_queue' /home/sachindhiman/.rvm/rubies/ruby-3.2.4/lib/ruby/3.2.0/bundler/worker.rb:90:in `block (2 levels) in create_threads'

An error occurred while installing rjb (1.4.9), and Bundler cannot continue.

In Gemfile: soapui-util was resolved to 0.47.0, which depends on rjb

How can we fix this issue?

Blackbaud-SachinDhiman commented 4 months ago

I tried installing the gem like this as well: gem 'rjb', :git =>'git@github.com:arton/rjb.git', :branch =>'master' ,:ref => '2c9693a20fcb477915361325f0c8901a43002011'

But no luck

arton commented 4 months ago

@Blackbaud-SachinDhiman

I wonder if you could explain that why you shouldn't install the latest version of Rjb?

BTW File.exists? is the valid method before Ruby 3.2.0. However your Ruby is 3.2.4. Your option was 1) use Ruby3.1.x or lower 2) use the latest version of Rjb from rubygems.org 3) apply monkey patch file such as

class File
  def self.exists?(n)
    exist?(n)
  end
end

and save it and require the file with option '-r' while you launch ruby 4) change your local extconf.rb /File.exists?/File.exist?/g

Regards.

Blackbaud-SachinDhiman commented 4 months ago

seems like soapui-util supports only rjb 1.4.9 ,

because my gem file contained only 2 gems (soapui-util and rjb)

so..for now i have used one of your workaround to get things done. Thanks.