Closed SilentGlasses closed 3 years ago
ruby-install only installs the rubies as-is. If older rubies are no longer maintained and not compatible with the current versions of gcc, openssl, etc, then they will fail to compile. Same thing would happen if you attempted to compile the ruby version manually. You would have to pass configuration options in to compile them against older versions of openssl, gcc, etc. It's much easier to simply upgrade to a newer Ruby version that's currently maintained by upstream.
same for ruby 2.6.8 on macos Big Sur 11.6 ruby-install v0.8.3
Consider using a patch to make it work.
In my case I've used the following patch:
diff --git a/parse.h b/parse.h
index b65ad8f..174e702 100644
--- a/parse.h
+++ b/parse.h
@@ -49,7 +49,10 @@ extern int yydebug;
# define YYTOKENTYPE
enum yytokentype
{
+ YYEMPTY = -2,
END_OF_INPUT = 0,
+ YYerror = 256, /* error */
+ YYUNDEF = 257, /* "invalid token" */
keyword_class = 258,
keyword_module = 259,
keyword_def = 260,
I saved it to disk and passed it to ruby-install -p /path/to/patch.patch ruby x.y.z
.
ripper
Can you help point us to where to look for patch.patch
?
@lacostenycoder If you are talking to me, I just created a gist you can use directly:
ruby-install -p https://gist.githubusercontent.com/To1ne/a21b5f38edeada462e6e2eba4582beec/raw/72322afd86f855ce8c2a2bb7888ecb6db4b5fcc0/ruby-install.patch ruby 2.5.1
I cannot guarantee though it will work for the version you're trying to install.
@To1ne thanks but it still doesn't work.
@lacostenycoder What's the exact error?
same issue here, not resolved yet!!
The issue seemed related to the version of Ubuntu 22.04, reverted to Ubuntu 20.04.5 LTS and issue was resolved.
@lacostenycoder If you are talking to me, I just created a gist you can use directly:
ruby-install -p https://gist.githubusercontent.com/To1ne/a21b5f38edeada462e6e2eba4582beec/raw/72322afd86f855ce8c2a2bb7888ecb6db4b5fcc0/ruby-install.patch ruby 2.5.1
I cannot guarantee though it will work for the version you're trying to install.
Thank you! That saved me!
Fresh install of both chruby and ruby-install on MacOS 10.15.7 using the homebrew method:
brew install ruby-install
brew install chruby
Attempt to install new ruby:
I tried with 2.2.4 and 2.5.0 they fail with their own errors but this is the latest one that I tried to install.
ruby-install ruby 2.5.1
Warnings
Fail