TaKO8Ki / frum

A little bit fast and modern Ruby version manager written in Rust
MIT License
636 stars 15 forks source link

can't find OpenSSL #113

Open DanielKehoe opened 2 years ago

DanielKehoe commented 2 years ago

I've updated my installation guide Install Ruby with Frum for Ruby 3.1. I'm advising to install OpenSSL using Homebrew before installing frum. However, after installing OpenSSL, frum, and Ruby 3.1, when I try to install the rails gem, I get:

$ gem install rails
ERROR:  While executing gem ... (Gem::Exception)
    OpenSSL is not available. Install OpenSSL and rebuild Ruby (preferred) or use non-HTTPS sources

Looking at closed issues, it looks like frum version 0.1.2 fixes any issues with OpenSSL. What am I overlooking? Do I need to install ruby with the option --with-openssl-dir=<ssl_dir>? Or do I need to add openssl to my PATH?

Let me know and I'll update my guide.

TaKO8Ki commented 2 years ago

What versions of frum do you use? From v0.1.2, frum uses openssl@1.1.

shanebarringer commented 2 years ago

I ran into a similar error while trying to bring up a rails app. Prefixing arch -arm64 to my requests seems to have fixed the issue.

arch -arm64 gem install bundler

Hope this helps!

151henry151 commented 2 years ago

I was able to get past the openssl issue by reinstalling ruby. Using frum,

frum uninstall 3.1.0
frum install 3.1.0 --with-openssl-dir=`brew --prefix openssl`
docljn commented 2 years ago

I'm unable to install any rubies using frum on an M1 running Monterey: not even with @151henry151 suggestion.

I think this is the same issue, so won't open a new one.

The error I get is

error: Can't build Ruby: make install: Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1

Generating RI format into /Users/lnoble/.frum/versions/.downloads/.tmpXy9clZ/ruby-2.7.5/.ext/rdoc...
/Users/lnoble/.frum/versions/.downloads/.tmpXy9clZ/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in 'require': cannot load such file -- openssl (LoadError)
    from /Users/lnoble/.frum/versions/.downloads/.tmpXy9clZ/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in 'require'
    from /Users/lnoble/.frum/versions/.downloads/.tmpXy9clZ/ruby-2.7.5/lib/rubygems/specification.rb:2430:in 'to_ruby'
    from ./tool/rbinstall.rb:846:in 'block (2 levels) in install_default_gem'
    from ./tool/rbinstall.rb:279:in 'open_for_install'
    from ./tool/rbinstall.rb:845:in 'block in install_default_gem'
    from ./tool/rbinstall.rb:835:in 'each'
    from ./tool/rbinstall.rb:835:in 'install_default_gem'
    from ./tool/rbinstall.rb:799:in 'block in <main>'
    from ./tool/rbinstall.rb:950:in 'block in <main>'
    from ./tool/rbinstall.rb:947:in 'each'
    from ./tool/rbinstall.rb:947:in '<main>'
make: *** [do-install-all] Error 1

frum versions returns 2.7.5 but attempting frum uninstall 2.7.5 results in

==> Uninstalling Ruby 2.7.5
error: No such file or directory (os error 2)

Hopefully this is useful information - sadly I don't know Rust.

shanebarringer commented 2 years ago

I'm unable to install any rubies using frum on an M1 running Monterey

@docljn Have you tried manually removing the 2.7.5 directory from .frum/versions?

$ rm -rf ~/.frum/versions/2.7.5
docljn commented 2 years ago

I did do exactly that @shanebarringer thank you. The joys of being an early adopter, I guess :)

shanebarringer commented 2 years ago

The joys of being an early adopter, I guess :)

I know right 🙃

Once you've removed it, maybe try prefixing arch -arm64 to your install request.

$ arch -arm64 frum install 2.7.5

that seems to have worked for me

TaKO8Ki commented 2 years ago

Does everyone in this issue use M1 mac? I want to know your environment like the following.

MacBook Air (M1, 2020) Apple M1 Memory 8G macOS Big Sur version 11.5.2 Frum: 0.1.0

adam12 commented 2 years ago

0.1.2 compiles everything without issue for me (pre 0.1.2, I did have openssl issues as without @1.1 in the prefix, it was targeting @3 on my machine by default).

One thing to mention is that if memory serves me correctly when the M1 was released, a lot of early adopters had to use arch -arm64 to install Homebrew.

That changed some months after, but I wonder if having to use arch -amd64 is now an unfortunate consequence of that initial install.

MacBook Air (M1, 2020) Apple M1 Memory 16GB macOS Monterey 12.0.1 From 0.1.2

error: No such file or directory (os error 2)

I noticed a similar error if there's a default alias symlink left.

shanebarringer commented 2 years ago

Does everyone in this issue use M1 mac? I want to know your environment...

@TaKO8Ki in reference to your question, here are my device specs

MacBook Pro (16-inch, 2021) Apple M1 Max Memory 32GB macOS Monterrey 12.0.1 Frum 0.1.2

151henry151 commented 2 years ago

Does everyone in this issue use M1 mac? I want to know your environment I am on macOS Monterey, Version 12.0.1, MacBook Pro (12-inch, M1, 2020) with 8GB memory, frum 0.1.2

docljn commented 2 years ago

maOS Monterey Version 12.1 MacBook Pro (14-inch, 2021) Apple M1 Pro Chip 16GB memory frum 0.1.2

TaKO8Ki commented 2 years ago

Thank you for your reply. I understand everyone uses Monterey on M1 mac. I don't have a M1 mac, but I'm going to look it into.

DanielKehoe commented 2 years ago

maOS Monterey Version 12.0.1 Mac Mini 2020 Apple M1 8GB memory frum 0.1.2

which -a brew
/opt/homebrew/bin/brew

FYI, Homebrew installs to a different directory on M1 than Intel.

fsegouin commented 1 year ago

Same issue here on M2. Such a shame I wanted to give frum a try. Has anyone found a solution?

frum install 2.7.5 --with-openssl-dir="/opt/homebrew/opt/openssl@3"
==> Downloading https://cache.ruby-lang.org/pub/ruby/2.7/ruby-2.7.5.tar.xz
==> Extracting ruby-2.7.5.tar.xz
==> Building Ruby 2.7.5
error: Can't build Ruby: make install:
Generating RI format into ~/.frum/versions/.downloads/.tmp7Ul3nL/ruby-2.7.5/.ext/rdoc...
~/.frum/versions/.downloads/.tmp7Ul3nL/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in `require': cannot load such file -- openssl (LoadError)
    from ~/.frum/versions/.downloads/.tmp7Ul3nL/ruby-2.7.5/lib/rubygems/core_ext/kernel_require.rb:83:in `require'
    from ~/.frum/versions/.downloads/.tmp7Ul3nL/ruby-2.7.5/lib/rubygems/specification.rb:2430:in `to_ruby'
    from ./tool/rbinstall.rb:846:in `block (2 levels) in install_default_gem'
    from ./tool/rbinstall.rb:279:in `open_for_install'
    from ./tool/rbinstall.rb:845:in `block in install_default_gem'
    from ./tool/rbinstall.rb:835:in `each'
    from ./tool/rbinstall.rb:835:in `install_default_gem'
    from ./tool/rbinstall.rb:799:in `block in <main>'
    from ./tool/rbinstall.rb:950:in `block in <main>'
    from ./tool/rbinstall.rb:947:in `each'
    from ./tool/rbinstall.rb:947:in `<main>'
make: *** [do-install-all] Error 1
monfresh commented 1 year ago

@fsegouin Ruby versions less than 3.1 don't support OpenSSL3. If you want to use OpenSSL 3, then you need to use Ruby 3.1 or higher. If you need to install 2.7.5, then you have to use OpenSSL 1.1

fsegouin commented 1 year ago

@monfresh Thanks! I was successful with this command: PKG_CONFIG_PATH=/opt/homebrew/opt/openssl@1.1/lib/pkgconfig frum install 2.7.5 --with-openssl-lib=/opt/homebrew/opt/openssl@1.1 --with-openssl-include=/opt/homebrew/opt/openssl@1.1

shileshv2 commented 4 months ago

I was installing ruby 3.x and got the error error: Can't build Ruby: make failed: . ./vm_opts.h

brew install libyml frum install 3.2.2

Ruby was installed successfully after installing libyml,

VanPaitin commented 1 week ago

I was installing ruby 3.x and got the error error: Can't build Ruby: make failed: . ./vm_opts.h

brew install libyml frum install 3.2.2 Ruby was installed successfully after installing libyml,

I think you meant to write

brew install libyaml instead of brew install libyml.

VanPaitin commented 1 week ago

In case another person runs into errors while trying to install later versions of ruby e.g 3.3.6 Screenshot 2024-11-18 at 20 25 52

Run the following the commands:

xcode-select --install

skip if you already have command line tools installed.

brew install autoconf automake libtool pkg-config libyaml openssl readline zlib

This installs essential dependencies required to compile/build ruby

export RUBY_CONFIGURE_OPTS="--with-openssl-dir=$(brew --prefix openssl) --with-libyaml-dir=$(brew --prefix libyaml) --with-readline-dir=$(brew --prefix readline)"

This env variables are necessary for frum to work correctly.

Then lastly, just install ruby:

frum install 3.3.6