그래서 나는 최근에 Mac 세계에 합류하여 내가 좋아하는 MacBook을 구입했습니다.
모든 개발 도구를 올바르게 설정하는 데 문제가 있으며 Linux CLI와 OSX CLI의 차이점에 100 % 익숙하지 않습니다.
지금은 RVM을 통해 몇 가지 다른 버전의 Ruby를 설치하려고합니다.
권장하는 것처럼 gcc4.2를 얻으려고했지만 어떤 컴파일러를 사용하든 비슷한 메시지가 나타납니다. 여기에서 2.0.0-preview2를 설치하려고하는데 다른 버전에서도 동일한 메시지가 나타납니다.
$ rvm install 2.0.0-preview2
No binary rubies available for: downloads/ruby-2.0.0-preview2.
Continuing with compilation. Please read 'rvm mount' to get more information on binary rubies.
Fetching openssl-1.0.1c.tar.gz to /usr/local/rvm/archives
Extracting openssl to /usr/local/rvm/src/openssl-1.0.1c
Configuring openssl in /usr/local/rvm/src/openssl-1.0.1c.
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./Configure darwin64-x86_64-cc -I/usr/local/rvm/usr/include -L/usr/local/rvm/usr/lib zlib no-asm no-krb5 shared --prefix=/usr/local/rvm/usr --with-opt-dir=/usr/local/rvm/usr', please read /usr/local/rvm/log/ruby-2.0.0-preview2/openssl/configure.log
Compiling openssl in /usr/local/rvm/src/openssl-1.0.1c.
Error running 'make', please read /usr/local/rvm/log/ruby-2.0.0-preview2/openssl/make.log
Updating openssl certificates
Error running 'update_openssl_certs', please read /usr/local/rvm/log/ruby-2.0.0-preview2/openssl.certs.log
Installing Ruby from source to: /usr/local/rvm/rubies/ruby-2.0.0-preview2, this may take a while depending on your cpu(s)...
ruby-2.0.0-preview2 - #downloading ruby-2.0.0-preview2, this may take a while depending on your connection...
ruby-2.0.0-preview2 - #extracted to /usr/local/rvm/src/ruby-2.0.0-preview2 (already extracted)
ruby-2.0.0-preview2 - #configuring
Error running 'env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-2.0.0-preview2 --with-opt-dir=/usr/local/rvm/usr:/usr/local/rvm/usr', please read /usr/local/rvm/log/ruby-2.0.0-preview2/configure.log
There has been an error while running configure. Halting the installation.
다음은 언급 된 네 가지 로그 파일의 출력입니다.
/usr/local/rvm/log/ruby-2.0.0-preview2/openssl/configure.log :
[2012-12-12 22:49:21] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./Configure darwin64-x86_64-cc -I/usr/local/rvm/usr/include -L/usr/local/rvm/usr/lib zlib no-asm no-krb5 shared --prefix=/usr/local/rvm/usr --with-opt-dir=/usr/local/rvm/usr
Usage: Configure [no-<cipher> ...] [enable-<cipher> ...] [experimental-<cipher> ...] [-Dxxx] [-lxxx] [-Lxxx] [-fxxx] [-Kxxx] [no-hw-xxx|no-hw] [[no-]threads] [[no-]shared] [[no-]zlib|zlib-dynamic] [no-asm] [no-dso] [no-krb5] [sctp] [386] [--prefix=DIR] [--openssldir=OPENSSLDIR] [--with-xxx[=vvv]] [--test-sanity] os/compiler[:flags]
/usr/local/rvm/log/ruby-2.0.0-preview2/openssl/make.log :
[2012-12-12 22:49:21] make
making all in crypto...
making all in crypto/objects...
/usr/bin/perl obj_dat.pl obj_mac.h obj_dat.h
/usr/bin/perl objxref.pl obj_mac.num obj_xref.txt > obj_xref.h
cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include -O -c -o obj_dat.o obj_dat.c
cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include -O -c -o obj_xref.o obj_xref.c
ar r ../../libcrypto.a o_names.o obj_dat.o obj_lib.o obj_err.o obj_xref.o
/usr/bin/ranlib: file: ../../libcrypto.a(ebcdic.o) has no symbols
/usr/bin/ranlib: file: ../../libcrypto.a(fips_ers.o) has no symbols
/usr/bin/ranlib ../../libcrypto.a || echo Never mind.
/usr/bin/ranlib: file: ../../libcrypto.a(ebcdic.o) has no symbols
/usr/bin/ranlib: file: ../../libcrypto.a(fips_ers.o) has no symbols
making all in crypto/md4...
make[2]: Nothing to be done for `all'.
making all in crypto/md5...
make[2]: Nothing to be done for `all'.
making all in crypto/sha...
make[2]: Nothing to be done for `all'.
making all in crypto/mdc2...
make[2]: Nothing to be done for `all'.
making all in crypto/hmac...
make[2]: Nothing to be done for `all'.
making all in crypto/ripemd...
make[2]: Nothing to be done for `all'.
making all in crypto/whrlpool...
make[2]: Nothing to be done for `all'.
making all in crypto/des...
cc -I.. -I../.. -I../modes -I../asn1 -I../evp -I../../include -O -c -o set_key.o set_key.c
set_key.c:399:17: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'unsigned int'
*(k++)=ROTATE(t2,30)&0xffffffffL;
~~~~~~~^~~~~~
./des_locl.h:170:19: note: expanded from macro 'ROTATE'
: "I"(n),"0"(a) \
^
set_key.c:402:17: error: unsupported inline asm: input with type 'unsigned long' matching output with type 'unsigned int'
*(k++)=ROTATE(t2,26)&0xffffffffL;
~~~~~~~^~~~~~
./des_locl.h:170:19: note: expanded from macro 'ROTATE'
: "I"(n),"0"(a) \
^
2 errors generated.
make[2]: *** [set_key.o] Error 1
make[1]: *** [subdirs] Error 1
make: *** [build_crypto] Error 1
/usr/local/rvm/log/ruby-2.0.0-preview2/openssl.certs.log :
[2012-12-12 22:49:24] update_openssl_certs
-bash: cd: /usr/local/rvm/usr/ssl: No such file or directory
/usr/local/rvm/log/ruby-2.0.0-preview2/configure.log :
[2012-12-12 22:49:24] env LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include ./configure --enable-shared --disable-install-doc --prefix=/usr/local/rvm/rubies/ruby-2.0.0-preview2 --with-opt-dir=/usr/local/rvm/usr:/usr/local/rvm/usr
checking build system type... x86_64-apple-darwin12.2.1
checking host system type... x86_64-apple-darwin12.2.1
checking target system type... x86_64-apple-darwin12.2.1
checking whether the C compiler works... no
configure: error: in `/usr/local/rvm/src/ruby-2.0.0-preview2':
configure: error: C compiler cannot create executables
See `config.log' for more details
OpenSSL은 homebrew를 통해 설치되었습니다.
$ brew info openssl
openssl: stable 1.0.1c
http://openssl.org
This formula is keg-only.
Mac OS X already provides this software and installing another version in
parallel can cause all kinds of trouble.
The OpenSSL provided by OS X is too old for some software.
/usr/local/Cellar/openssl/1.0.1c (429 files, 15M)
https://github.com/mxcl/homebrew/commits/master/Library/Formula/openssl.rb
누군가 올바른 방향으로 나를 가리킬 수 있습니까? 나는 분명한 것이 빠진 것 같은 느낌이 든다.
미리 감사드립니다.
답변
Xcode, CLI 도구, openssl (brew), autoconf (brew), automake (brew) 및 apple-gcc42 (brew)를 다시 설치하면 해결됩니다. 다시 설치 한 후 실행했습니다 rvm get head
(freenode에서 #rvm의 @mpapis 덕분에). rvm get head
나에게 다음을 주었다.
* WARNING: you have 'rvm_configure_env' in /etc/rvmrc, run the following to fix:
sudo sed -i'' -e "s#rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include')#rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')#" /etc/rvmrc
* No new notes to display.
# RVM: Shell scripts enabling management of multiple ruby environments.
# RTFM: https://rvm.io/
# HELP: http://webchat.freenode.net/?channels=rvm (#rvm on irc.freenode.net)
# Cheatsheet: http://cheat.errtheblog.com/s/rvm/
# Screencast: http://screencasts.org/episodes/how-to-use-rvm
# In case of any issues read output of 'rvm requirements' and/or 'rvm notes'
Upgrade of RVM in /usr/local/rvm/ is complete.
# hinmn,
#
# Thank you for using RVM!
# I sincerely hope that RVM helps to make your life easier and
# more enjoyable!!!
#
# ~Wayne
RVM reloaded!
그 후 나는 방금 달렸다.
sudo sed -i'' -e "s#rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib CFLAGS=-I/opt/sm/pkg/active/include CPATH=/opt/sm/pkg/active/include')#rvm_configure_env=('LDFLAGS=-L/opt/sm/pkg/active/lib' 'CFLAGS=-I/opt/sm/pkg/active/include' 'CPATH=/opt/sm/pkg/active/include')#" /etc/rvmrc
그리고 모든 것이 해결되었습니다 🙂
답변
비슷한 문제가 있었고 주로 다음과 같은 패키지를 설치하지 않은 것으로 나타났습니다.
libxslt @1.1.27_0 (active)
libyaml @0.1.4_1 (active)
llvm-3.2 @3.2_1 (active)
llvm_select @0.2_0 (active)
llvm-3.2는 openssl이 ./Configure and Make를 실행할 수 없기 때문에 주요 문제라고 생각하는 gcc 컴파일러입니다.
이것들이 먼저 설치되어 있는지 확인하고 모든 것을 다시 설치하기 전에 도움이 될 것입니다. Ruby 2.0.0 / Rails 3.1.1을 작동시키는 데 2 일이 걸렸으므로 누군가에게 도움이되기를 바랍니다.