Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can't find OpenSSL #113

Open
DanielKehoe opened this issue Jan 2, 2022 · 17 comments
Open

can't find OpenSSL #113

DanielKehoe opened this issue Jan 2, 2022 · 17 comments

Comments

@DanielKehoe
Copy link
Contributor

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
Copy link
Owner

TaKO8Ki commented Jan 3, 2022

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

@shanebarringer
Copy link

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
Copy link

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
Copy link

docljn commented Jan 13, 2022

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
Copy link

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
Copy link

docljn commented Jan 13, 2022

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

@shanebarringer
Copy link

shanebarringer commented Jan 13, 2022

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
Copy link
Owner

TaKO8Ki commented Jan 13, 2022

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
Copy link

adam12 commented Jan 13, 2022

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
Copy link

shanebarringer commented Jan 13, 2022

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
Copy link

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
Copy link

docljn commented Jan 14, 2022

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

@TaKO8Ki
Copy link
Owner

TaKO8Ki commented Jan 14, 2022

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
Copy link
Contributor Author

DanielKehoe commented Jan 15, 2022

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
Copy link

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
Copy link

@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
Copy link

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants