Failed to build ruby 2.7.5 on ubuntu 22.04 #1940
-
When trying to install ruby 2.7.5 using OS: Ubuntu 22.04
|
Beta Was this translation helpful? Give feedback.
Replies: 17 comments 45 replies
-
Be sure to follow our recommended build setup for your OS. For Ubuntu, I would ensure that you've installed at least |
Beta Was this translation helpful? Give feedback.
-
Hi, was wondering if there was an update to this error? |
Beta Was this translation helpful? Give feedback.
-
Unfortunately, Ubuntu 22.04 only provides OpenSSL 3.0, which is supported only by Ruby versions 3.1+. Older versions of Ruby need OpenSSL 1.1, which doesn't come with newer Ubuntu out of the box. |
Beta Was this translation helpful? Give feedback.
-
I found that I could compile 3.1.1 ok
So I migrated all my ruby projects to 3.1.1 and Rails 7 (I was going to do
it anyway, just was not planning to do it so soon)
Cheers
…--------------------------------------------------------
Chris Martin
m: +61 419 812 371
e: ***@***.***
--------------------------------------------------------
On Wed, 13 Apr 2022 at 10:20, Hiroshi SHIBATA ***@***.***> wrote:
FYI: https://bugs.ruby-lang.org/issues/18658#note-4
—
Reply to this email directly, view it on GitHub
<#1940 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABSB7IV6SMAZYRUUHEKBBQDVEYHNHANCNFSM5PBHWW3A>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Beta Was this translation helpful? Give feedback.
-
I met exactly the same problem. Ruby 2.7 is essential for me to use for jekyll and github page since Ruby 3.x is incompatible with github page. I try to install Ruby 2.7 via rbenv in Ubuntu 22.04 and got this issue. 😂 |
Beta Was this translation helpful? Give feedback.
-
I have faced the same issue. |
Beta Was this translation helpful? Give feedback.
-
Facing the same issue here since upgrading to 22.04 LTS when trying to install 2.7.5 via rbenv. Downloading ruby-2.7.5.tar.bz2... BUILD FAILED (Ubuntu 22.04 using ruby-build 20211227-3-gcdc215e) Inspect or clean up the working tree at /tmp/ruby-build.20220428175448.2543631.uzBfU1 Last 10 log lines: from ./tool/rbinstall.rb:950:in block in <main>' from ./tool/rbinstall.rb:947:in each'from ./tool/rbinstall.rb:947:in `' make: *** [uncommon.mk:373: do-install-all] Error 1 |
Beta Was this translation helpful? Give feedback.
-
Following the suggestion of @mislav, I compiled OpenSSL 1.1.1 and it worked. I tested on Ubuntu 22.04 and Fedora 36. Install the dependencies Ubuntu 22.04: $ sudo apt install build-essential checkinstall zlib1g-dev Fedora 36: $ sudo dnf groupinstall "Development Tools"
$ sudo dnf install perl-core zlib-devel Download OpenSSL 1.1.1
Compile it
Link the system's certs to OpenSSL 1.1.1 directory
Install ruby Use
It works with
If you want to make this permanent, add this line to your
Then you don't need to use |
Beta Was this translation helpful? Give feedback.
-
I stumbled upon this issue today as well.
And it worked. |
Beta Was this translation helpful? Give feedback.
-
Thanks... that solution worked perfect. |
Beta Was this translation helpful? Give feedback.
-
Worked for me! |
Beta Was this translation helpful? Give feedback.
-
Does not work for 2.7.3 but work for 3.1.2 RUBY_CONFIGURE_OPTS=--with-openssl-dir=/opt/openssl-1.1.1o rbenv install 2.7.3
BUILD FAILED (Ubuntu 22.04 using ruby-build 20220426-3-g1038c07)
Inspect or clean up the working tree at /tmp/ruby-build.20220522135821.31657.Iqe8Ck
Results logged to /tmp/ruby-build.20220522135821.31657.log
Last 10 log lines:
linking shared-object bigdecimal.so
make[2]: Leaving directory '/tmp/ruby-build.20220522135821.31657.Iqe8Ck/ruby-2.7.3/ext/bigdecimal'
ripper.y: At top level:
cc1: note: unrecognized command-line option ‘-Wno-self-assign’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-parentheses-equality’ may have been intended to silence earlier diagnostics
cc1: note: unrecognized command-line option ‘-Wno-constant-logical-operand’ may have been intended to silence earlier diagnostics
linking shared-object ripper.so
make[2]: Leaving directory '/tmp/ruby-build.20220522135821.31657.Iqe8Ck/ruby-2.7.3/ext/ripper'
make[1]: Leaving directory '/tmp/ruby-build.20220522135821.31657.Iqe8Ck/ruby-2.7.3'
make: *** [uncommon.mk:295: build-ext] Error 2 |
Beta Was this translation helpful? Give feedback.
-
Worked for me. |
Beta Was this translation helpful? Give feedback.
-
rbenv install 2.7.5 gives me "ruby-build: definition not found: 2.7.5" not able to find 2.7.5 with "rbenv install --list" Also need this for Github Pages.. |
Beta Was this translation helpful? Give feedback.
-
I got the same error trying to use rbenv to install 2.7.1, and part of this Ask Ubuntu answer helped me. I'll leave this here in case it helps someone else. Here is what I did:
I'm not sure if both of those are needed, or if only libssl-dev is needed, but after installing both of those, I was able to successfully install Ruby 2.7.1 using Also, I should mention, the reason I need Ruby 2.7.1 is because Github Pages does not support Jekyll 4 and Jekyll 3 requires Ruby 2.x. I suspect others are in the same situation. Edit to add: The next time I did |
Beta Was this translation helpful? Give feedback.
Unfortunately, Ubuntu 22.04 only provides OpenSSL 3.0, which is supported only by Ruby versions 3.1+.
Older versions of Ruby need OpenSSL 1.1, which doesn't come with newer Ubuntu out of the box.