Skip to content

Building ruby on mac m1 #5252

@rachitpant

Description

@rachitpant

Description

Steps to reproduce

Unable to install a universal ruby with rvm.

  1. 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/[email protected]/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/[email protected] --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 recognized
configure: 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/[email protected]/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/[email protected] --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: ""

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions