-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Building ruby on mac m1 #5252
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
Comments
I will also add that i am trying to build ruby in the hopes this universal ruby would be able to build ruby-oci8. |
Did you find any solution? |
I checked the log of
brew install openssl@1.1
export PATH="$(brew --prefix)/opt/openssl@1.1/bin:$PATH"
export LDFLAGS="-L$(brew --prefix)/opt/openssl@1.1/lib"
export CPPFLAGS="-I$(brew --prefix)/opt/openssl@1.1/include"
export PKG_CONFIG_PATH="$(brew --prefix)/opt/openssl@1.1/lib/pkgconfig"
rvm autolibs disable
export RUBY_CFLAGS=-DUSE_FFI_CLOSURE_ALLOC
export optflags="-Wno-error=implicit-function-declaration"
rvm install 3.0.0 --with-openssl-dir=$(brew --prefix)/opt/openssl@1.1 and finally I got |
For me, uninstalling brew and rvm and reinstalling it did the trick: |
@simonknoll but you can not uninstall every time you need to install a new version |
you don't have to, i've installed 2.7.2 and 3.1.2 |
I was entirely unable (after quite a lot of trying) to get 3.0.2 to install on my M1. That includes using the instructions posted here and elsewhere. No joy. Tried multiple versions of openssl, messing with the includes directory - nothing I tried worked. Fortunately, 3.1.3 did install, at least for me. |
this working for me M1-macbook air |
@leedrum you save my day, thanks a lot 🥳 |
The |
That one helped for me!!! So what I did... brew uninstall openssl Then install OpenSSL 1 using brew: brew install openssl@1.1 PKG_CONFIG_PATH=$(brew --prefix openssl@1.1)/lib/pkgconfig rvm install 2.7.2 |
Description
Steps to reproduce
Unable to install a universal ruby with rvm.
rvm install ruby-2.7.2 -C --with-arch=x86_64,arm64
Expected behavior
Expected rvm to make a universal build of ruby2.7.2
Actual behavior
rpant@MBK-WCV41P7JVM ncaa-forms % rvm install ruby-2.7.2 -C --with-arch=x86_64,arm64 Checking requirements for osx. Certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem' is already up to date. Requirements installation successful. Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby. Installing Ruby from source to: /Users/rpant/.rvm/rubies/ruby-2.7.2, this may take a while depending on your cpu(s)... ruby-2.7.2 - #downloading ruby-2.7.2, this may take a while depending on your connection... ruby-2.7.2 - #extracting ruby-2.7.2 to /Users/rpant/.rvm/src/ruby-2.7.2 - please wait ruby-2.7.2 - #configuring - please wait Error running './configure --prefix=/Users/rpant/.rvm/rubies/ruby-2.7.2 --with-arch=x86_64 arm64 --with-opt-dir=/opt/homebrew/opt/libyaml:/opt/homebrew/opt/libksba:/opt/homebrew/opt/readline:/opt/homebrew/opt/zlib:/opt/homebrew/opt/openssl@1.1 --disable-install-doc --enable-shared', please read /Users/rpant/.rvm/log/1663273468_ruby-2.7.2/configure.log There has been an error while running configure. Halting the installation.
Output of configure.log
configure: WARNING: you should use --build, --host, --target
checking for ruby... /Users/rpant/.rvm/rubies/ruby-3.0.0/bin/ruby
tool/config.guess already exists
tool/config.sub already exists
checking build system type... Invalid configuration
arm64': machine
arm64-unknown' not recognizedconfigure: error: /bin/sh tool/config.sub arm64 failed
Environment info
rpant@MBK-WCV41P7JVM ncaa-forms % rvm remove ruby-2.7.2
ruby-2.7.2 - #removing src/ruby-2.7.2 - please wait
ruby-2.7.2 - #removing rubies/ruby-2.7.2 - please wait
ruby-2.7.2 - #removing gems - please wait
ruby-2.7.2 - #removing wrappers - please wait
ruby-2.7.2 - #removing environments - please wait
Using /Users/rpant/.rvm/gems/ruby-3.0.0
rpant@MBK-WCV41P7JVM ncaa-forms % rvm list
=* ruby-3.0.0 [ arm64 ]
=> - current
=* - current && default
* - default
rpant@MBK-WCV41P7JVM ncaa-forms % rvm install ruby-2.7.2 -C --with-arch=x86_64,arm64
Checking requirements for osx.
Certificates bundle '/opt/homebrew/etc/openssl@1.1/cert.pem' is already up to date.
Requirements installation successful.
Warning: DYLD_LIBRARY_PATH environment variable is set, this might interact with the compilation and ruby.
Installing Ruby from source to: /Users/rpant/.rvm/rubies/ruby-2.7.2, this may take a while depending on your cpu(s)...
ruby-2.7.2 - #downloading ruby-2.7.2, this may take a while depending on your connection...
ruby-2.7.2 - #extracting ruby-2.7.2 to /Users/rpant/.rvm/src/ruby-2.7.2 - please wait
ruby-2.7.2 - #configuring - please wait
Error running './configure --prefix=/Users/rpant/.rvm/rubies/ruby-2.7.2 --with-arch=x86_64 arm64 --with-opt-dir=/opt/homebrew/opt/libyaml:/opt/homebrew/opt/libksba:/opt/homebrew/opt/readline:/opt/homebrew/opt/zlib:/opt/homebrew/opt/openssl@1.1 --disable-install-doc --enable-shared',
please read /Users/rpant/.rvm/log/1663273468_ruby-2.7.2/configure.log
There has been an error while running configure. Halting the installation.
rpant@MBK-WCV41P7JVM ncaa-forms % rvm info
ruby-3.0.0:
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
system:
uname: "Darwin MBK-WCV41P7JVM 21.2.0 Darwin Kernel Version 21.2.0: Sun Nov 28 20:28:41 PST 2021; root:xnu-8019.61.5~1/RELEASE_ARM64_T6000 arm64"
name: "OSX"
version: "12.1"
architecture: "arm64"
bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)"
zsh: "/bin/zsh => zsh 5.8 (x86_64-apple-darwin21.0)"
remote_path: "osx/12.1/arm64"
xcode: ""
rvm:
version: "1.29.12 (latest)"
updated: "8 days 4 hours 35 minutes 16 seconds ago"
path: "/Users/rpant/.rvm"
autolibs: "[4] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."
ruby:
interpreter: "ruby"
version: "3.0.0p0"
date: "2020-12-25"
platform: "arm64-darwin21"
patchlevel: "2020-12-25 revision 95aff21468"
full_version: "ruby 3.0.0p0 (2020-12-25 revision 95aff21468) [arm64-darwin21]"
homes:
gem: "/Users/rpant/.rvm/gems/ruby-3.0.0"
ruby: "/Users/rpant/.rvm/rubies/ruby-3.0.0"
binaries:
ruby: "/Users/rpant/.rvm/rubies/ruby-3.0.0/bin/ruby"
irb: "/Users/rpant/.rvm/rubies/ruby-3.0.0/bin/irb"
gem: "/Users/rpant/.rvm/rubies/ruby-3.0.0/bin/gem"
rake: "/Users/rpant/.rvm/rubies/ruby-3.0.0/bin/rake"
environment:
PATH: "/Users/rpant/.rvm/gems/ruby-3.0.0/bin:/Users/rpant/.rvm/gems/ruby-3.0.0@global/bin:/Users/rpant/.rvm/rubies/ruby-3.0.0/bin:/Users/rpant/.rvm/bin:/Users/rpant/.nvm/versions/node/v18.4.0/bin:/opt/homebrew/bin:/opt/homebrew/sbin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Users/rpant/code/ncaa-forms/node_modules/.bin:/Users/rpant/Library/Application Support/JetBrains/Toolbox/scripts:/Library/Oracle/instantclient_19_8"
GEM_HOME: "/Users/rpant/.rvm/gems/ruby-3.0.0"
GEM_PATH: "/Users/rpant/.rvm/gems/ruby-3.0.0:/Users/rpant/.rvm/gems/ruby-3.0.0@global"
MY_RUBY_HOME: "/Users/rpant/.rvm/rubies/ruby-3.0.0"
IRBRC: "/Users/rpant/.rvm/rubies/ruby-3.0.0/.irbrc"
RUBYOPT: ""
gemset: ""
The text was updated successfully, but these errors were encountered: