Skip to content

Instantly share code, notes, and snippets.

@skunkworker
Created April 6, 2026 22:55
Show Gist options
  • Select an option

  • Save skunkworker/c19e69813cc64212939572fefac30f76 to your computer and use it in GitHub Desktop.

Select an option

Save skunkworker/c19e69813cc64212939572fefac30f76 to your computer and use it in GitHub Desktop.
Weird JRuby platform issue
gem 'rake'
platforms :ruby do
gem 'pg'
end
# JRuby specific gems
platforms :jruby do
# A JDBC-based ActiveRecord adapter for Postgres
gem "activerecord-jdbcpostgresql-adapter", "~> 72"
gem "jruby-openssl", "~> 0.15"
end

bundler: bundler 4.0.9

ruby: cruby 3.4.9 jruby: jruby-10.0.4.0

arch: macos 26.4

Steps

  1. switch to cruby 3.4.9 rbenv local 3.4.9
  2. bundle install
  3. add platforms bundle lock --add-platform arm64-darwin x86_64-linux universal-java
  4. PLATFORMS should look like
PLATFORMS
  aarch64-linux
  aarch64-linux-musl
  arm64-darwin
  ruby
  universal-java
  x86_64-darwin
  x86_64-linux
  x86_64-linux-musl
  1. delete lock rm Gemfile.lock
  2. switch to JRuby rbenv local jruby-10.0.4.0
  3. add platforms bundle lock --add-platform arm64-darwin x86_64-linux universal-java
  4. blows up
Fetching gem metadata from https://rubygems.org/........
Resolving dependencies...
Could not find gem 'activerecord-jdbcpostgresql-adapter (~> 72) jruby' with
platform 'universal-java' in rubygems repository https://rubygems.org/ or
installed locally.

The source contains the following gems matching
'activerecord-jdbcpostgresql-adapter (~> 72) jruby':
  * activerecord-jdbcpostgresql-adapter-72.0-java
  * activerecord-jdbcpostgresql-adapter-72.1-java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment