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

Installation of >=v7.0.1 fails with JRuby #2350

Open
hummeltech opened this issue Aug 16, 2023 · 5 comments
Open

Installation of >=v7.0.1 fails with JRuby #2350

hummeltech opened this issue Aug 16, 2023 · 5 comments

Comments

@hummeltech
Copy link

hummeltech commented Aug 16, 2023

I believe this commit (first released with v7.0.1) is causing the installation of the activerecord-oracle_enhanced-adapter gem to fail when using JRuby.

Steps to reproduce

Passing (7.0.0):

$ cd $(mktemp --directory)
$ printf 'jruby-9.4.3.0\n' > .ruby-version
$ rbenv install --skip-existing
$ printf 'source "https://rubygems.org"\ngem "activerecord-oracle_enhanced-adapter", "7.0.0"\n' > Gemfile
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using bundler 2.4.14
Using concurrent-ruby 1.2.2
Using ruby-plsql 0.8.0
Using i18n 1.14.1
Using tzinfo 2.0.6
Using minitest 5.19.0
Using activesupport 7.0.7
Using activemodel 7.0.7
Using activerecord 7.0.7
Using activerecord-oracle_enhanced-adapter 7.0.0
Bundle complete! 1 Gemfile dependency, 10 gems now installed.
Use `bundle info [gemname]` to see where a bundled gem is installed.

Failing (7.0.1):

$ cd $(mktemp --directory)
$ printf 'jruby-9.4.3.0\n' > .ruby-version
$ rbenv install --skip-existing
$ printf 'source "https://rubygems.org"\ngem "activerecord-oracle_enhanced-adapter", "7.0.1"\n' > Gemfile
$ bundle install
Fetching gem metadata from https://rubygems.org/..........
Resolving dependencies...
Using bundler 2.4.14
Using concurrent-ruby 1.2.2
Using ruby-plsql 0.8.0
Using minitest 5.19.0
Using i18n 1.14.1
Using tzinfo 2.0.6
Using activesupport 7.0.7
Using activemodel 7.0.7
Using activerecord 7.0.7
Installing ruby-oci8 2.2.12 with native extensions
Gem::Ext::BuildError: ERROR: Failed to build gem native extension.
...
An error occurred while installing ruby-oci8 (2.2.12), and Bundler
cannot continue.

In Gemfile:
  activerecord-oracle_enhanced-adapter was resolved to 7.0.1, which depends on
    ruby-oci8

Expected behavior

The activerecord-oracle_enhanced-adapter gem should install without requiring ruby-oci8

Actual behavior

The ruby-oci8 gem is being required.

System configuration

Rails version:
N/A

Oracle enhanced adapter version:
>= 7.0.1

Ruby version:
JRuby 9.4.3.0

Oracle Database version:
N/A

@davue
Copy link

davue commented Sep 19, 2023

Using the gem from source via the path option works fine.

I suspect that it's required to build two variants of the gem for each platform as the uploaded variant in rubygems.org was built using CRuby and thus requires ruby-oci8.

@hummeltech
Copy link
Author

Thanks, yes, that's basically what I have been doing as a work-around until a solution can be found, I.E.:

git_source(:github) { |repo| "https://github.com/#{repo}.git" }
gem "activerecord-oracle_enhanced-adapter", github: "rsim/oracle-enhanced"

@iaddict
Copy link

iaddict commented Oct 23, 2023

I have the same problem, but loading from github is not an option for me, because of corporate firewall rules.

Thus I cloned the repository, switched to the v7.0.3 tag and built the gem with jruby.

jruby -S bundle
jruby -S bundle exec rake build

I copied the resulting gem to vendor/cache and installed/updated with bundle update --local.

This gem then works. So the problem is, that no jruby version of the gem has been published.

@davue
Copy link

davue commented Dec 27, 2023

In fact there was never a Java version published for this gem as you can see here but this was no issue so far because all dependencies were cross-compatible.

Only the person(s) who publishes this gem can fix this.

@hummeltech
Copy link
Author

hummeltech commented Dec 27, 2023

Thank you for pointing that out @davue, that explains it.

And thank you for the link, I can now show what I discovered in the commit mentioned in the issue report.

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

No branches or pull requests

3 participants