postmodern / ruby-install

Installs Ruby, JRuby, TruffleRuby, or mruby
MIT License
1.91k stars 255 forks source link

Ruby 3? #389

Closed MtnBiker closed 3 years ago

MtnBiker commented 3 years ago

Maybe I should be more patient but I'm getting this error from ruby-install ruby:

 Downloading https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.bz2 into /Users/…/src ...
--2020-12-26 10:52:57--  https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.0.tar.bz2
Resolving cache.ruby-lang.org (cache.ruby-lang.org)... 151.101.41.178
Connecting to cache.ruby-lang.org (cache.ruby-lang.org)|151.101.41.178|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
aonemd commented 3 years ago

Here to confirm the issue.

larouxn commented 3 years ago

This seems to be because ruby-install tries to download tar.bz2s but there isn't one available for Ruby 3.0.0.

Screen Shot 2020-12-27 at 17 21 30 Screen Shot 2020-12-27 at 17 21 43

Strangely, tar.bz2s exist for 3.0.0-preview1 and seemingly all prior full release Ruby versions such as 2.7.2.

Screen Shot 2020-12-27 at 17 25 18
robzolkos commented 3 years ago

Update to the latest ruby-install 0.8.1 and it will work fine. On MacOS with homebrew brew upgrade ruby-install

meineerde commented 3 years ago

For reference: this was changed/fixed in a86f18bbf3bfe271e870f2b63df6248020273c1d and is released starting from version 0.8.0.

MtnBiker commented 3 years ago

@robzolkos Worked for me. I thought all the brews were updating. I wasn't paying attention between update and upgrade. update: only brew itself. upgrade: upgrade all the brews. English isn't precise enough for the difference.

larouxn commented 3 years ago

Update to the latest ruby-install 0.8.1 and it will work fine. On MacOS with homebrew brew upgrade ruby-install

Confirmed, was able to install Ruby 3.0.0 after upgrading. Thanks! 🙌

>>> Successfully installed ruby 3.0.0 into /Users/larouxn/.rubies/ruby-3.0.0

kvz commented 3 years ago

I upgraded to 0.8.1 but still got the warning:

ruby-install: 0.8.1
*** Unknown ruby version 3.0.0. Proceeding anyways ...

and then it does go on to compile (successfully) as it states, so this is more of a nitpick in case you were unaware of the warning :)

tejasbubane commented 3 years ago

Folks from here could you share your MacOS and xcode versions over at https://github.com/postmodern/ruby-install/issues/390 please?

marcandre commented 3 years ago

False alarm, #390 is resolved.

stillhart commented 3 years ago

.tar.bz2 has been removed as target in current and future versions of ruby, see https://bugs.ruby-lang.org/issues/16483#note-7

It means the only way is to upgrade ruby-install.

chrisseaton commented 3 years ago

I still seem to get this error on 0.8.1:

% ruby-install --version
ruby-install: 0.8.1
% ruby-install ruby-3.0 
*** Unknown ruby version 3.0. Proceeding anyways ...
>>> Installing ruby 3.0 into /Users/chrisseaton/.rubies/ruby-3.0 ...
>>> Installing dependencies for ruby 3.0 ...
>>> Downloading https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.tar.xz into /Users/chrisseaton/src ...
--2021-01-09 14:43:24--  https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.tar.xz
Resolving cache.ruby-lang.org (cache.ruby-lang.org)... 199.232.53.178
Connecting to cache.ruby-lang.org (cache.ruby-lang.org)|199.232.53.178|:443... connected.
HTTP request sent, awaiting response... 404 Not Found
2021-01-09 14:43:24 ERROR 404: Not Found.

!!! Download of https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.tar.xz failed!

Trying https://cache.ruby-lang.org/pub/ruby/3.0/ruby-3.0.tar.xz manually gives me

<Error>
<Code>NoSuchKey</Code>
<Message>The specified key does not exist.</Message>
<Key>pub/ruby/3.0/ruby-3.0.tar.xz</Key>
<RequestId>29013B321E235D46</RequestId>
<HostId>
VX88KMo5DhqcmxLpM0fMZ9GN8BouFkGNVloeuIwod4ennNtdiI/IRACeZ3wDSJ9RxO12l/c8W70=
</HostId>
</Error>
NickLaMuro commented 3 years ago

@chrisseaton If you look at the cache at the directory level:

https://cache.ruby-lang.org/pub/ruby/3.0/

You will see that you will need to add a patch version of .0 to the end of your ruby version in your ruby-install call, and it should work just fine:

-% ruby-install ruby-3.0
+% ruby-install ruby-3.0.0

Edit: Looks like a ruby-install -L might also update your local cache so that doing a ruby-install ruby-3.0 would be possible. Haven't tried myself though.


P.S. Thanks to this thread pointing me to needing to upgrade, instead of me trying to hack together non-bz2 support myself 😆

postmodern commented 3 years ago

@chrisseaton @NickLaMuro normally ruby-install ruby-3.0 should resolve to 3.0.X. I suspect it's due to the versions list being outdated, so 3.0 is being interpreted as a literal version that's not yet known. ruby-install could possibly try to auto-update the ruby-versions files if the version cannot be resolved, then try again.

postmodern commented 3 years ago

This is related to #366 which was released in 0.8.0. Upgrade to ruby-install >= 0.8.0.