English 中文(简体)
ma rub rub rub installation installation installation installation installation installation
原标题:mac os ruby installation fails on -> make -j 8

I have tried rbenv, rvm, asdf but they all fail at -> make -j 8.

Apple M1
14.3 (Sonoma)
asdf install ruby latest 
ruby-build: using openssl@3 from homebrew
==> Downloading ruby-3.3.0.tar.gz...
-> curl -q -fL -o ruby-3.3.0.tar.gz https://cache.ruby-lang.org/pub/ruby/3.3/ruby-3.3.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100 21.0M  100 21.0M    0     0  8732k      0  0:00:02  0:00:02 --:--:-- 8734k
==> Installing ruby-3.3.0...
ruby-build: using libyaml from homebrew
ruby-build: using gmp from homebrew
-> ./configure "--prefix=$HOME/.asdf/installs/ruby/3.3.0" --with-openssl-dir=/usr/local/opt/openssl@3 --enable-shared --with-libyaml-dir=/usr/local/opt/libyaml --with-gmp-dir=/usr/local/opt/gmp --with-ext=openssl,psych,+
-> make -j 8
*** Following extensions are not compiled:
openssl:
        Could not be configured. It will not be installed.
        /private/var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7/ruby-3.3.0/ext/openssl/extconf.rb:122: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
        Check /var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7/ruby-3.3.0/ext/openssl/mkmf.log for more details.
psych:
        Could not be configured. It will not be installed.
        Check /var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7/ruby-3.3.0/ext/psych/mkmf.log for more details.

BUILD FAILED (macOS 14.3 on arm64 using ruby-build 20240221)

You can inspect the build directory at /var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7
See the full build log at /var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.log
brew --prefix openssl
/usr/local/opt/openssl@3
ls -la /usr/local/opt/openssl@3
lrwxr-xr-x@ 1 a  admin  25 Feb 26 20:54 /usr/local/opt/openssl@3 -> ../Cellar/openssl@3/3.2.1

记录

=== Checking for required stuff failed. ===
Makefile wasn t created. Fix the errors above.
/private/var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7/ruby-3.3.0/ext/openssl/extconf.rb:122: OpenSSL library could not be found. You might want to use --with-openssl-dir=<dir> option to specify the prefix where OpenSSL is installed.
    /private/var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7/ruby-3.3.0/ext/openssl/extconf.rb:122:in `<top (required)> 
    ./ext/extmk.rb:219:in `load 
    ./ext/extmk.rb:219:in `block in extmake 
    /private/var/folders/hz/hfxt6dnj14v6_6qt7t23ppm80000gn/T/ruby-build.20240226205446.26544.yrtoY7/ruby-3.3.0/lib/mkmf.rb:314:in `open 
    ./ext/extmk.rb:215:in `extmake 
    ./ext/extmk.rb:634:in `block in <main> 
    ./ext/extmk.rb:630:in `each 
    ./ext/extmk.rb:630:in `<main> 
ld: warning: ignoring file  /usr/local/Cellar/libyaml/0.2.5/lib/libyaml-0.2.dylib : found architecture  x86_64 , required architecture  arm64 
ld: Undefined symbols:
  _yaml_get_version, referenced from:
      _t in conftest-a05b11.o
clang: error: linker command failed with exit code 1 (use -v to see invocation)
checked program was:
/* begin */
 1: #include "ruby.h"
 2:
 3: /*top*/
 4: extern int t(void);
 5: int main(int argc, char **argv)
 6: {
 7:   if (argc > 1000000) {
 8:     int (* volatile tp)(void)=(int (*)(void))&t;
 9:     printf("%d", (*tp)());
10:   }
11:
12:   return !!argv[argc];
13: }
14: extern void yaml_get_version();
15: int t(void) { yaml_get_version(); return 0; }
/* end */
问题回答

my brew was set to:

which brew
/usr/local/bin/brew

这使得它安装了x86。

确保:

which brew
/opt/homebrew/bin/brew

a. 为我的M1Mac安装适当装置。

这用开放式、准日、心理等手段解决了成功安装的垃圾。





相关问题
Ruby parser in Java

The project I m doing is written in Java and parsers source code files. (Java src up to now). Now I d like to enable parsing Ruby code as well. Therefore I am looking for a parser in Java that parses ...

rails collection_select vs. select

collection_select and select Rails helpers: Which one should I use? I can t see a difference in both ways. Both helpers take a collection and generates options tags inside a select tag. Is there a ...

RubyCAS-Client question: Rails

I ve installed RubyCAS-Client version 2.1.0 as a plugin within a rails app. It s working, but I d like to remove the ?ticket= in the url. Is this possible?

Ordering a hash to xml: Rails

I m building an xml document from a hash. The xml attributes need to be in order. How can this be accomplished? hash.to_xml

multiple ruby extension modules under one directory

Can sources for discrete ruby extension modules live in the same directory, controlled by the same extconf.rb script? Background: I ve a project with two extension modules, foo.so and bar.so which ...

Text Editor for Ruby-on-Rails

guys which text editor is good for Rubyonrails? i m using Windows and i was using E-Texteditor but its not free n its expired now can anyone plese tell me any free texteditor? n which one is best an ...

热门标签