Replies: 2 comments 1 reply
-
While searching for a solution I noticed there is already is PR #1793 for that, sorry that I missed that. |
Beta Was this translation helpful? Give feedback.
-
Hi, until our mirror features get some improvements, the correct way to set up your mirror is not to proxy https://cache.ruby-lang.org/pub/ruby/, but to download the Ruby tarballs that you want to have in your own mirror, rename each download to the sha256 sum of the file, then have your mirror serve those renamed files. ruby-build will then try a URL against your mirror like https://cache-pub-ruby/d1991690a4e17233ec6b3c7844c1e1245c0adce3e00d713551d0458467b727b1 for Ruby 3.3.9. I understand that since these tarballs have to be renamed like this for ruby-build to be able to find them is not exactly a "mirror", but we made that choice so that mirror servers don't have to reflect the same directory structure as https://cache.ruby-lang.org. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
we would like to use a internal mirror to download ruby.
We did a proxy for https://cache.ruby-lang.org/pub/ruby/ but that url does not accept a hash. How can we still use it as mirror?
Let's assume our mirror url is https://cache-pub-ruby/.
RUBY_BUILD_MIRROR_URL
RUBY_BUILD_MIRROR_URL=https://cache-pub-ruby/ rbenv install --verbose 3.3.9
tries https://cache-pub-ruby/d1991690a4e17233ec6b3c7844c1e1245c0adce3e00d713551d0458467b727b1
curl -q -fL -o ruby-3.3.9.tar.gz https://cache-pub-ruby/d1991690a4e17233ec6b3c7844c1e1245c0adce3e00d713551d0458467b727b1
doesn't work since the url does not accept any hash.
RUBY_BUILD_MIRROR_PACKAGE_URL
RUBY_BUILD_MIRROR_PACKAGE_URL=https://cache-pub-ruby/ rbenv install --verbose 3.3.9
tries https://cache-pub-ruby/
curl -q -fL -o ruby-3.3.9.tar.gz https://cache-pub-ruby/
tries to directly download the package without specifying the version.
I also noted that http_head_curl returns 400 for my mirror, meaning it never uses any of the provided urls and will always use the original url. I removed the http head part (https://github.com/rbenv/ruby-build/blob/master/bin/ruby-build#L506) locally to check what url it then will try to get.
I guess the easiest solution would be to mirror an endpoint that accepts the hash but I couldn't find it on https://cache.ruby-lang.org/.
My workaround now is to execute
curl -q -fL -o "$(rbenv root)/cache/ruby-3.3.9.tar.gz" https://cache-pub-ruby/3.3/ruby-3.3.9.tar.gz
How can is setup my mirror correctly?
Beta Was this translation helpful? Give feedback.
All reactions