Ruby bindings do not install, incorrect gemfile

Hi all - tried to open an issue, but the repo is locked to collaborators. Anywho, the Ruby bindings (fdb gem) do not install, and I suspect it has been an issue since cmake began compiling the gem in 2019 (link omitted because according to the forum, “New users can only add two links to a post”, lol).

The specific error when you try to gem install fdb is:

Gem::Package::PathError: installing into parent path /home/foundationdb_ci/src/oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo/foundationdb/LICENSE of /Users/andrew/.rbenv/versions/3.2.1/lib/ruby/gems/3.2.0/gems/fdb-7.2.2 is not allowed

I believe this is because the files array is specifying things like ${CMAKE_SOURCE_DIR}/LICENSE. If I download the gem file manually and unpack it, we can see that the included metadata.gz file specifies absolute paths, like:

- "/home/foundationdb_ci/src/oOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOoOo/foundationdb/LICENSE"

Whereas the files array from a gem that installs correctly looks more like:

- Gemfile
- Rakefile
- debug.gemspec
- exe/rdbg
- ext/debug/debug.c
- ext/debug/extconf.rb

Note the use of relative paths. I am not familiar with the CI setup of foundationdb nor with building gemspecs with cmake, but I believe that the fix is as simple as specifying files in the same manner as the non-cmake gemspec version.

I would open a PR to correct it, but - repo is locked. :upside_down_face:

Thanks! We’ll open the repo for PRs later. In the meantime, can you post the link for your change, e.g., something like Then we can create the PR for it.

Definitely - here’s a link for the gem fix. It was a little more involved than I thought - like the python bindings, I needed to copy things into place in the build directory. I will admit that I’m not incredibly familiar with C build systems, and so I don’t know if this the best way to do things (I basically copied things from the python cmake files): Comparing apple:main...ahayworth:ahayworth/fix-ruby-binding-build · apple/foundationdb · GitHub

I figured that I should actually test the gem, and then learned that the gem won’t actually load on non-x86 machines! I loosened the restriction to allow arm64 as well, and it seemed to work just fine in case you’d like to take that change as well: Comparing apple:main...ahayworth:ahayworth/ruby-arm64 · apple/foundationdb · GitHub

I didn’t test the arm64 change in any thorough way, but it did at least allow me to set and retrieve a key.

Thanks! I’ve opened two PRs with your fixes.

Fantastic, thanks so much!