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

Getting cannot load such file -- zlib while installing ruby 2.2.5 #4980

Closed
aryanagarwal15 opened this issue Sep 22, 2020 · 5 comments
Closed
Milestone

Comments

@aryanagarwal15
Copy link

aryanagarwal15 commented Sep 22, 2020

Description

Getting this error
cannot load such file -- zlib

while running
rvm install 2.2.5 --rubygems 2.7.6

have tried various fixes mentioned in issues which include
rvm reinstall 2.2.5 --with-zlib-dir=$(brew --prefix zlib) --rubygems 2.7.6
&
rvm pkg install zlib

error is coming while ruby-2.2.5 - #installing rubygems-2.7.6 - please wait

Steps to reproduce

run rvm install 2.2.5 --rubygems 2.7.6

Expected behavior

install ruby 2.2.5

Actual behavior

Debug mode:

Environment info

`ruby-2.7.0:

system:
uname: "Darwin Aryans-MacBook-Pro.local 19.6.0 Darwin Kernel Version 19.6.0: Thu Jun 18 20:49:00 PDT 2020; root:xnu-6153.141.1~1/RELEASE_X86_64 x86_64"
name: "OSX"
version: "10.15"
architecture: "x86_64"
bash: "/bin/bash => GNU bash, version 3.2.57(1)-release (x86_64-apple-darwin19)"
zsh: "/bin/zsh => zsh 5.7.1 (x86_64-apple-darwin19.0)"
remote_path: "osx/10.15/x86_64"
xcode: "12.0"

rvm:
version: "1.29.10 (latest)"
updated: "2 hours 20 minutes 42 seconds ago"
path: "/Users/aryan/.rvm"
autolibs: "[enable] Allow RVM to use package manager if found, install missing dependencies, install package manager (only OS X)."

ruby:
interpreter: "ruby"
version: "2.7.0p0"
date: "2019-12-25"
platform: "x86_64-darwin19"
patchlevel: "2019-12-25 revision 647ee6f091"
full_version: "ruby 2.7.0p0 (2019-12-25 revision 647ee6f091) [x86_64-darwin19]"

homes:
gem: "/Users/aryan/.rvm/gems/ruby-2.7.0"
ruby: "/Users/aryan/.rvm/rubies/ruby-2.7.0"

binaries:
ruby: "/Users/aryan/.rvm/rubies/ruby-2.7.0/bin/ruby"
irb: "/Users/aryan/.rvm/rubies/ruby-2.7.0/bin/irb"
gem: "/Users/aryan/.rvm/rubies/ruby-2.7.0/bin/gem"
rake: "/Users/aryan/.rvm/rubies/ruby-2.7.0/bin/rake"

environment:
PATH: "/Users/aryan/.rvm/gems/ruby-2.7.0/bin:/Users/aryan/.rvm/gems/ruby-2.7.0@global/bin:/Users/aryan/.rvm/rubies/ruby-2.7.0/bin:/usr/local/opt/openssl@1.1/bin:/Users/aryan/.pyenv/shims:/Users/aryan/.pyenv/bin:/usr/local/opt/mysql@5.6/bin:/Users/aryan/.gem/ruby/2.7.0/bin:/Users/aryan/.nvm/versions/node/v14.7.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin:/Applications/Postgres.app/Contents/Versions/latest/bin:/opt/nginx/sbin/:/Users/aryan/.rvm/bin"
GEM_HOME: "/Users/aryan/.rvm/gems/ruby-2.7.0"
GEM_PATH: "/Users/aryan/.rvm/gems/ruby-2.7.0:/Users/aryan/.rvm/gems/ruby-2.7.0@global"
MY_RUBY_HOME: "/Users/aryan/.rvm/rubies/ruby-2.7.0"
IRBRC: "/Users/aryan/.rvm/rubies/ruby-2.7.0/.irbrc"
RUBYOPT: ""
gemset: ""`

@raelgc
Copy link
Contributor

raelgc commented Sep 22, 2020

Hi @aryanagarwal15 and thanks for reporting this issue.

Can you, please, fill the other missing info, so we can help you?

@aryanagarwal15
Copy link
Author

@raelgc I've added my environment info, is anything else needed to be added?

@uestcsp
Copy link

uestcsp commented Sep 24, 2020

me too, This problem has bothered me for weeks....... life is so hard 😂

@aryanagarwal15
Copy link
Author

I was able to find a solution for this issue. On 17th September 2020 Apple released Command-Line-Tools 12 which breaks rvm installation. To solve this I had to revert to Command-line-Tools 11.5

To check if this is the error with your machine run clang --version

If the version is 12 then you must downgrade.

Process:

  1. I read you cannot install it well without uninstalling completely previous installs, so I did sudo rm -rf /Library/Developer/CommandLineTools
  2. I downloaded the command line Tools for XCode version 11.5 (I am using Catalina 10.15.6), and the next version, 12, is for Big Sur that will come out next month. Here is the link: Command line tools for Xcode Installation [You must have Apple developer(Free) account to access this]
  3. When the installation finished, I restarted the computer
  4. I checked the path of these tools: Xcode-select --print-path
  5. Finally, I ran sudo xcode-select -switch /Library/Developer/CommandLineTools since it was not the correct path.

Original Comment explaining this: rbenv/ruby-build#1473 (comment)

@uestcsp
Copy link

uestcsp commented Oct 9, 2020

yes, it's the XCode issuse

@pkuczynski pkuczynski added this to the rvm-1.29.11 milestone Dec 29, 2020
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

4 participants