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

Failed to install ruby 3.2.2 on M2 Pro with macOS Ventura 13.3 #344

Closed
uxgnod opened this issue Apr 10, 2023 · 20 comments
Closed

Failed to install ruby 3.2.2 on M2 Pro with macOS Ventura 13.3 #344

uxgnod opened this issue Apr 10, 2023 · 20 comments

Comments

@uxgnod
Copy link

uxgnod commented Apr 10, 2023

Install ruby 3.2.2 with asdf install ruby 3.2.2 failed with following logs

To follow progress, use 'tail -f /var/folders/dc/48z1w1s10zd696901ff70qmw0000gn/T/ruby-build.20230410235200.45419.log' or pass --verbose
Downloading ruby-3.2.2.tar.gz...
-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.2.tar.gz
Installing ruby-3.2.2...

BUILD FAILED (macOS 13.3 using ruby-build 20230330)

Inspect or clean up the working tree at /var/folders/dc/48z1w1s10zd696901ff70qmw0000gn/T/ruby-build.20230410235200.45419.RMKe2o
Results logged to /var/folders/dc/48z1w1s10zd696901ff70qmw0000gn/T/ruby-build.20230410235200.45419.log

Last 10 log lines:
	Check ext/psych/mkmf.log for more details.
*** Fix the problems, then remove these directories and try again if you want.
Generating RDoc documentation
/private/var/folders/dc/48z1w1s10zd696901ff70qmw0000gn/T/ruby-build.20230410235200.45419.RMKe2o/ruby-3.2.2/lib/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).
To eliminate this warning, please install libyaml and reinstall your ruby.
uh-oh! RDoc had a problem:
cannot load such file -- psych

run with --debug for full backtrace
make: *** [rdoc] Error 1

I tried this answer #328 (comment) but not working.

@theblang
Copy link

I'm seeing Version not found when running asdf install ruby 3.2.2

@viraptor
Copy link

@theblang that's unrelated, it just means your ruby-build is not to date yet. Run asdf plugin update ruby to fix that.

@pboling
Copy link

pboling commented Apr 21, 2023

You can also use the newer-than-latest-release of ruby-build with (from README):

ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.2.2

@etewiah
Copy link

etewiah commented Apr 21, 2023

asdf plugin update ruby

Even after running above I do not get ruby 3.2.2 listed when I run asdf list-all ruby

@xcolour
Copy link

xcolour commented Apr 21, 2023

@uxgnod I had the same issue (M1, macOS 13.3.1).

I was able to resolve by installing libyaml from homebrew (brew install libyaml) and then installing normally (asdf install ruby latest). I ultimately did not need to set any of the custom build options suggested in #328 (comment).

@pboling
Copy link

pboling commented Apr 24, 2023

@etewiah It sounds like the command asdf plugin update ruby is failing for you. You'll have to make sure that works first. Alternatively, you can try running the command:

ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.2.2

@pmgower
Copy link

pmgower commented Jun 3, 2023

@uxgnod and @xcolour I had a similar issue with build and psych (Intel MBP 2019, macOS 13.4) and was able to resolve it by installing libyaml via homebrew (brew install libyaml) and then installed normally (asdf install ruby 3.2.2).

Same as you @xcolour, I did not need any of the custom build options.

@etewiah
Copy link

etewiah commented Jun 3, 2023

@pboling , sorry only saw your comment after I fixed it. Your tip was indeed correct. Many thanks!

@pboling
Copy link

pboling commented Jun 3, 2023

@Stratus3D I think this can be closed.

@uxgnod
Copy link
Author

uxgnod commented Jun 6, 2023

@pboling Sorry I forgot to reply and update the status of this issue earlier. The way you mentioned can indeed solve the problem, and I agree that the issue has been resolved and I will close this.

@uxgnod uxgnod closed this as completed Jun 6, 2023
@stidch
Copy link

stidch commented Sep 19, 2023

I would be nice to have a solution without the need of installing libyaml with brew first.

Can't this be fixed on the asdf/ruby side?

@jhussain123
Copy link

I have libyaml installed and it's not working again.
piyush.chandana@Piyush Chandana QYM29N6YRC ~ % ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.2.1

Downloading ruby-build...

To follow progress, use 'tail -f /var/folders/_2/89qhh6gj0lgfyd8bfrhhb7yw0000gq/T/ruby-build.20231009132436.87244.log' or pass --verbose

Downloading openssl-3.1.3.tar.gz...

-> https://dqw8nmjcqpjn7.cloudfront.net/f0316a2ebd89e7f2352976445458689f80302093788c466692fb2a188b2eacf6

Installing openssl-3.1.3...

Installed openssl-3.1.3 to /Users/piyush.chandana/.asdf/installs/ruby/3.2.1

Downloading ruby-3.2.1.tar.gz...

-> https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.1.tar.gz

Installing ruby-3.2.1...

ruby-build: using readline from homebrew

ruby-build: using libyaml from homebrew

ruby-build: using gmp from homebrew

BUILD FAILED (macOS 13.6 using ruby-build 20230919)

Inspect or clean up the working tree at /var/folders/_2/89qhh6gj0lgfyd8bfrhhb7yw0000gq/T/ruby-build.20231009132436.87244.mX7Gm4

Results logged to /var/folders/_2/89qhh6gj0lgfyd8bfrhhb7yw0000gq/T/ruby-build.20231009132436.87244.log

Last 10 log lines:

/usr/local/include/secure/_string.h:106:5: warning: '__IPHONE_OS_VERSION_MIN_REQUIRED' is not defined, evaluates to 0 [-Wundef]

#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 70000 || __MAC_OS_X_VERSION_MIN_REQUIRED >= 1090 || \

^

217 warnings generated.

195 warnings generated.

217 warnings generated.

195 warnings generated.

195 warnings generated.

196 warnings generated.

195 warnings generated.

@Jason733i
Copy link

I was able to fix my similarly broken ruby install by deleting the system installed gems located in ~/.gem (my GEM_HOME directory).

@pletoss
Copy link

pletoss commented Oct 26, 2023

Why is this issue closed ? Installing libyaml from homebrew seems like a temporary workaround, since defeats the purpose of using asdf as being "one tool" only to manage these.

For example, we're using asdf in our CI jobs to automatically pull tools on several machines/agents that the builds are running. Now we would need to manually install homebrew, and then install libyaml on all agents and future agents that we might add.

Can't this be fixed by updating the install script ?

@pboling
Copy link

pboling commented Oct 26, 2023

@pletoss The fix for many people is simply to use the latest build of ruby-build, which is done with:

ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.2.2

No need to do anything with libyaml there.

@pletoss
Copy link

pletoss commented Oct 27, 2023

@pletoss The fix for many people is simply to use the latest build of ruby-build, which is done with:

ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.2.2

No need to do anything with libyaml there.

Thanks for the tip. Tried that, however while it works on macos build machines, it still fails on linux:

BUILD FAILED (Ubuntu 18.04 using ruby-build 20231025)

Inspect or clean up the working tree at /tmp/ruby-build.20231026185539.24531.pKDJQ3

Results logged to /tmp/ruby-build.20231026185539.24531.log

Last 10 log lines:

make[1]: Leaving directory '/tmp/ruby-build.20231026185539.24531.pKDJQ3/ruby-3.2.2'

Generating RDoc documentation

/tmp/ruby-build.20231026185539.24531.pKDJQ3/ruby-3.2.2/lib/yaml.rb:3: warning: It seems your ruby installation is missing psych (for YAML output).

To eliminate this warning, please install libyaml and reinstall your ruby.

uh-oh! RDoc had a problem:

cannot load such file -- psych

@pboling
Copy link

pboling commented Oct 27, 2023

It failed generating documentation. If you don't need it (such as on a non-development environment), you can turn off the documentation part of the build.

This issue is a little confusing, from typos, and I am not sure of the current state of the defaults and switches - but it can be done.

#19

@guicattani
Copy link

guicattani commented Nov 1, 2023

Thanks for the tip. Tried that, however while it works on macos build machines, it still fails on linux:

You need to install libyaml-dev and zlib1g-dev beforehand for it to work with that command. Or ignore the documentation as recommended by @pboling.

@egdbear
Copy link

egdbear commented Nov 10, 2023

What works for me:

ruby 3 versions
ASDF_RUBY_BUILD_VERSION=master asdf install ruby 3.2.2

ruby older versions
brew uninstall --ignore-dependencies openssl@3
ASDF_RUBY_BUILD_VERSION=master asdf install ruby 2.7.5

@asleepace
Copy link

brew uninstall --ignore-dependencies openssl@3
ASDF_RUBY_BUILD_VERSION=master asdf install ruby 2.7.5

Awesome, was stuck on this for a while, this worked:

brew uninstall --ignore-dependencies openssl@3
ASDF_RUBY_BUILD_VERSION=master asdf install ruby 2.7.5

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