#1069089 ruby-rubygems: Broken platform detection which lead to unability to install sass-embedded #1069089
- Package:
- ruby-rubygems
- Source:
- ruby-rubygems
- Submitter:
- Simon Elst
- Date:
- 2025-04-09 11:51:04 UTC
- Severity:
- normal
* What led up to the situation?
Trying to build a website with Jekyll (through "bundle exec jekyll serve").
* What exactly did you do (or not do) that was effective (or ineffective)?
1. Running "bundle" on a Jekyll fresh new site with "minimal" template
2. Installing missing gem ("sass-embedded") with "gem install" command, and
then running "bundle exec jekyll serve".
* What was the outcome of this action?
1. Bundler::HTTPError: Could not download gem from https://rubygems.org/ due to
underlying error <bad response Forbidden 403 (https://rubygems.org/gems/sass-
embedded-1.75.0-x86_64-linux.gem)>
2. Install works, but it brings "sass-embedded (1.75.0 x86_64-linux-android)"
instead of "[...]-linux-gnu)". Then, the bundle exec command fails :
"Conversion error: Jekyll::Converters::Scss encountered an error while
converting 'assets/main.scss': Broken pipe"
* What outcome did you expect instead?
Bundle should install sass-embedded (linux-gnu).
It looks like it is related to a patch in Debian version (3.4.20) that breaks
platform detection. The bug is pointed out here :
https://github.com/jekyll/jekyll/issues/9478#issuecomment-1785797746
My usecase and the full terminal transcript are available here :
https://www.reddit.com/r/Jekyll/comments/1c4g90p/unable_to_build_site_because_of_sass/
Hi, I think I am hitting a similar issue -- trying to install a bundle that contains the "ffi" gem leads to an error: Bundler::HTTPError: Could not download gem from https://rubygems.org/ due to underlying error <bad response Forbidden 403 (https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem)> /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/rubygems_integration.rb:497:in `rescue in download_gem' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/rubygems_integration.rb:469:in `download_gem' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:481:in `download_gem' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:443:in `fetch_gem' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:427:in `fetch_gem_if_possible' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/source/rubygems.rb:161:in `install' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/gem_installer.rb:54:in `install' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/gem_installer.rb:16:in `install_from_spec' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/parallel_installer.rb:156:in `do_install' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/installer/parallel_installer.rb:147:in `block in worker_pool' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:62:in `apply_func' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:57:in `block in process_queue' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:54:in `loop' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:54:in `process_queue' /usr/share/rubygems-integration/all/gems/bundler-2.4.20/lib/bundler/worker.rb:90:in `block (2 levels) in create_threads' Indeed the file https://rubygems.org/gems/ffi-1.17.0-x86_64-linux.gem does not exist. The correct filename seems to be https://rubygems.org/gems/ffi-1.17.0-x86_64-linux-gnu.gem. I don't know anything about Ruby, gem, or bundler so I am quite stuck here, and unable to execute Jekyll unfortunately. Kind regards, Ralf
Hi again, Turns out I can fix things by manually editing /usr/lib/ruby/vendor_ruby/rubygems/platform.rb, and un-doing the patch mentioned at <https://github.com/jekyll/jekyll/issues/9478#issuecomment-1785797746>. But that's obviously quite the hack; would be nice if the faulty patch could be removed from the Debian package so that one can use bundler again. Kind regards, Ralf
I think this same issue is triggering a FTBFS in rake-compiler[1], and removing the mentioned patch also seems to fix that issue. I'm not sure whether it makes sense to drop this patch in rubygems or to patch rake-compiler to accept the change here in rubygems, in either case something will need to be done for these packages to live harmoniously. 1: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1054732#10
Awesome, Ralf's manual fix worked for me as well! Thanks! M3.
Hello, RubyGems upstream maintainer here. I heard that Bundler now has trouble installing the proper platform specific version of any gems that ship “non-gnu” variants (not only `sass-embedded`) when using RubyGems packed by Debian due to this issue. That means that people using Debian stable fail to use Jekyll: https://github.com/jekyll/jekyll/issues/9478#issuecomment-1785797746. I’m not fully sure about this issues introduced by the upstream patch but happy to help out with making it possible to revert the patch. Thanks!
Hi,
The patch mentioned in the jekyll issue was written by me, and looks
like this:
───────┬─────────────────────────────────────────────────────────────────────────────────
│ File: debian/patches/0002-Gem-Platform-emulate-3.3.15-behavior-on-Ruby-3.1.patch
───────┼─────────────────────────────────────────────────────────────────────────────────
1 │ From: Antonio Terceiro <terceiro@debian.org>
2 │ Date: Fri, 13 Oct 2023 11:14:01 -0300
3 │ Subject: Gem::Platform: emulate 3.3.15 behavior on Ruby 3.1
4 │
5 │ rubygems 3.4 calls a Linux platform something like aarch64-linux-gnu,
6 │ where 3.3 called it just aarch64-linux. Given all the existing native
7 │ extensions for Ruby 3.1 in the Debian archive had been built
8 │ using rubygems 3.3, let's keep the old behavior on Ruby 3.1 as to not
9 │ immediately break all the existing extensions.
10 │ ---
11 │ lib/rubygems/platform.rb | 3 +++
12 │ 1 file changed, 3 insertions(+)
13 │
14 │ diff --git a/lib/rubygems/platform.rb b/lib/rubygems/platform.rb
15 │ index b721629..34d94bd 100644
16 │ --- a/lib/rubygems/platform.rb
17 │ +++ b/lib/rubygems/platform.rb
18 │ @@ -117,6 +117,9 @@ def initialize(arch)
19 │ when /^(\w+_platform)(\d+)?/ then [ $1, $2 ]
20 │ else [ "unknown", nil ]
21 │ end
22 │ +
23 │ + # emulate behavior from 3.3.15 on ruby 3.1
24 │ + @version = nil if (RUBY_VERSION < "3.2" && @os == "linux")
25 │ when Gem::Platform then
26 │ @cpu = arch.cpu
27 │ @os = arch.os
───────┴─────────────────────────────────────────────────────────────────────────────────
As far as I can remember, it was necessary in order to not need to
rebuilding every single Debian package that had been compiled before
rubygems 3.4. The workaround mentioned in a previous message will work,
but it will also break all the Debian ruby-* packages that contain
compiled code.
But, as you can see, the changed behavior only applies to ruby < 3.2. We
are about to start a transition to ruby 3.3, and that will probably take
a few months. After the transition is done, this problem will no longer
be relevant.
With that said, I could not reproduce this issue with the current
default ruby. If someone can provide a minimal reproducer, I can try to
look into it.
Hi Antonio! Indeed if this is only a problem in Ruby < 3.1, it does not seem like a big deal. I think it’s probably fine to leave things as they are. Thank you!
Hi all, Maintainer of sass-embedded gem here. The reason you can no longer reproduce this issue on Debian ruby 3.1 is because I blocked ruby 3.1 from installing precompiled Linux gem since 1.77.1: https://github.com/sass-contrib/sass-embedded-host-ruby/commit/2c145537c7c3fe4e3c4da47845b9cd402e06ecee If you try to install 1.77.0, you will see that it’s still broken on Debian ruby 3.1, as expected. As Trixie is going to become stable soon, and it will have ruby 3.3, I don’t have a huge concern if we don’t fix this. Natsuki
Hi, I read the discussion in https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1069089 and believe that this bug can be marked as fixed in the version in debian testing/trixie, 3.6.6-1. Since that bug was opened, Debian testing moved to Ruby 3.3 and Rubygems 3.6.x. I believe that the bug still affects Debian stable. I'm Ccing people who contributed to the discussion -- if you can reproduce this issue on Debian testing, please let us know. Lucas