ncbo / ontologies_api

Hypermedia API for NCBO's ontology-related projects
http://data.bioontology.org
Other
25 stars 10 forks source link

Bundle install command fails on macOS with Ruby 3.0.6 #142

Open jvendetti opened 5 months ago

jvendetti commented 5 months ago

I'm unable to upgrade to my local development environment from Ruby 2.7.8 to 3.0.6 (macOS Sonoma 14.3.1).

The bundle install command fails with:

An error occurred while installing bigdecimal (1.4.2), and Bundler cannot continue.

Our code is pinned to an old version of the bigdecimal library from December, 2018 (version 1.4.2). According to their compatibility chart, we should be using >= 2.0 with Ruby 3. If you unpin the library and modify the Gemfile to something like this:

gem 'bigdecimal', '~> 2.0'

... then the bundle install command succeeds, but the unit tests immediately fail with:

activesupport-3.2.22.5/lib/active_support/core_ext/object/duplicable.rb:111:in `<class:BigDecimal>': undefined method `new' for BigDecimal:Class (NoMethodError)

Again, our code is pinned to an old version of the activesupport gem from September, 2016 (version 3.2.22.5). If you unpin activesupport, e.g.:

gem 'activesupport', '~> 7.0'

... then the bundle install command starts failing again with:

Fetching gem metadata from https://rubygems.org/.........
Resolving dependencies...
Could not find compatible versions

Because activesupport >= 6.1.0.rc1 depends on minitest >= 5.1
  and Gemfile depends on activesupport ~> 7.0,
  minitest >= 5.1 is required.
So, because Gemfile depends on minitest ~> 4.0,
  version solving has failed.

Again, our code is pinned to an old version of the minitest gem, which we've already documented in #113.

There's been a lot of discussion about moving all of the libraries that make up the BioPortal REST API to Ruby 3, which I support. However, I don't see how we can continue advancing the version of Ruby we support without first sorting out our dependencies on several very old libraries.

As of now I have no way to develop ontologies_api locally against Ruby 3.

syphax-bouazzouni commented 5 months ago

Hello @jvendetti, I had also this issue when trying to use Ruby 3, some time ago, I did this code refactoring https://github.com/ncbo/ontologies_api/pull/143, which fixed that and updated our code to work with Minitest 5.

But just be aware, that I have not yet found time, to deploy it fully on our side, so take this PR with precaution, but I think at least it is a good starting point to the Minitest migration.

jvendetti commented 5 months ago

Thanks for submitting a starting point @syphax-bouazzouni