Unable to install the sqlean gem
This is a bit of a weird one. There's a popular set of SQLite extensions called sqlean. To make working with them easier, @flavorjones packaged up the precompiled SQLite extensions into sqlean gem. The gem itself does not have any native code, but it packages up precompiled versions of the SQLite extensions and so it's published as platform-specific gems. As such, they can't install on TruffleRuby:
Could not find gems matching 'sqlean (>= 0.3.0)' valid for all resolution
platforms (aarch64-linux, aarch64-linux-gnu, arm64-darwin-24, x86_64-linux,
x86_64-linux-gnu, x86_64-linux-musl, ruby) in rubygems repository
https://rubygems.org/ or installed locally.
The source contains the following gems matching 'sqlean (>= 0.3.0)':
* sqlean-0.3.0-aarch64-linux-gnu
* sqlean-0.3.0-arm64-darwin
* sqlean-0.3.0-x64-mingw
* sqlean-0.3.0-x86_64-darwin
* sqlean-0.3.0-x86_64-linux-gnu
* sqlean-0.3.0-x86_64-linux-musl
As far as I can tell, the gem should work just fine on TruffleRuby, but it cannot be installed. Given the newfound prevalence of SQLite3 usage with Rails 8, I think we should try to find a way to resolve this issue. Fortunately, it's not yet a default gem in Rails.
@nirvdrum The sqlean gem was really only intended as a proof-of-concept. It's pretty limited and doesn't even support all the platforms I'd like it to.
I think if someone really wants to use any of the sqlean extensions they'd be better off using https://github.com/fractaledmind/sqlpkg-ruby which supports a broader set of extensions, which are compiled at installation time (which should work great with Truffleruby, I think?).
Can you help me understand better why this caught your attention?
$ TRUFFLERUBYOPT="--experimental-options --reuse-precompiled-gems=sqlean" gem i sqlean
Fetching sqlean-0.3.0-x86_64-linux-gnu.gem
Successfully installed sqlean-0.3.0-x86_64-linux-gnu
1 gem installed
can be used as a way to install platform-specific gems (i.e., we have an option for this now).
Ref:
- https://github.com/rubygems/rubygems/issues/2945
- https://github.com/rubygems/rfcs/pull/60
@flavorjones I had done some ugly stuff in Rails to support UUIDv7 keys in SQLite. A friend of mine suggested the sqlean gem as a solution. The gem ranks very favorably when searching for the non-Ruby SQLean project. I did see the sqlpkg gem, but it looked way more complicated. If that's the way to go though, I can.
@eregon Thanks for the info. That's awesome. I'll try it out with Bundler.