Unable to install Ruby 1.9.3 on Mountain Lion w / RVM: Error starting make

I'm trying to install Ruby so that I can complete the Learn Ruby the Hard Way course and I just had trouble installing the latest version of Ruby

Here is the relevant part of my journal:

compiling md5ossl.c linking shared-object digest/md5.bundle ld: in /usr/local/lib/libz.1.dylib, file was built for unsupported file format ( 0xce 0xfa 0xed 0xfe 0x 7 0x 0 0x 0 0x 0 0x 3 0x 0 0x 0 0x 0 0x 6 0x 0 0x 0 0x 0 ) which is not the architecture being linked (x86_64): /usr/local/lib/libz.1.dylib for architecture x86_64 collect2: ld returned 1 exit status make[2]: *** [../../../.ext/x86_64-darwin12.1.0/digest/md5.bundle] Error 1 make[1]: *** [ext/digest/md5/all] Error 2 make: *** [build-ext] Error 2 

I ran into googled and found this message similar to the same problem: Unable to install Ruby 1.9.3 on Mountain Lion w / Jewlery Box: Error starting make -j4 (there is current readline, gcc)

But the answer is the ambiguous "libz lib update". I don't know what this means, I googled around and found zlib, but I don't know if they are the same as libz? I also found another message indicating libz is libtool, my version of libtool is the version of Apple Inc. cctools-829, but is libtool the same as libz? I have never seen any of these conditions before or used Ruby before, and I'm just completely confused.

I have gcc 4.2.1 and xcode 4.4.1. Thanks for any help, this is my first post here, please kindly let me know if I did something wrong or you need to provide additional information. I basically stole my title from the name that I contacted because I was not sure how to format the headers, I hope that everything is in order.

+4
source share
1 answer

As a side note, OS X doesn't put anything in /usr/local/lib or /usr/local/bin , so you should have installed something there, perhaps even inadvertently.

If you use a Ruby manager, such as rvm or rbenv , then they have special build tools to help with this process. This is much simpler than installing from the source, as the correct fixes apply not only to Ruby, but also to dependencies like libz .

You may have libraries compiled for the wrong architecture on your computer. They may have been ported from an old PowerPC installation, or even a 32-bit version of Intel from OS X up to 10.5.

It is best to simply remove /usr/local/lib/libz* and use the ones that come bundled with your OS. You should have a set of required files in /usr/lib/libz* that might work.

+1
source

Source: https://habr.com/ru/post/1432845/


All Articles