问题
I am fairly amateur when it comes to Terminal and command line therefore I thought I might pose my question here and hopefully one of the many intelligent folks roaming this board would be so kind as to help me understand what I am doing wrong here. I am trying to install 1.9.3 on my Mac for a project on Team Treehouse. I already have 2.0.0 installed. Any help would be great. Thank you. Here is the read out from the log.
roberts-imac:~ Jones$ rvm install 1.9.3
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Error: No available formula for gcc46
Installing requirements for osx.
Updating system.......
Error running 'requirements_osx_brew_update_system ruby-1.9.3-p547',
showing last 15 lines of /Users/Jones/.rvm/log/1404462414_ruby-1.9.3-p547/update_system.log
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.'
++ rvm_pretty_print stderr
++ case "${rvm_pretty_print_flag:=auto}" in
++ case "${TERM:-dumb}" in
++ case "$1" in
++ [[ -t 2 ]]
++ return 1
++ printf %b 'Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.\n'
Failed to update Homebrew, follow instructions here:
https://github.com/Homebrew/homebrew/wiki/Common-Issues
and make sure `brew update` works before continuing.
++ return 1
Requirements installation failed with status: 1.
roberts-imac:~ Jones$
Update: So I went ahead and did the xcode install as well as running the brew update and this is what I am getting in my log after trying to install 1.9.3.
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.9/x86_64/ruby-1.9.3-p547.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Error: No available formula for gcc46
Installing requirements for osx.
Updating system....
Installing required custom packages: homebrew/versions.
Installing required packages: gcc46............
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Jones/.rvm/rubies/ruby-1.9.3-p547, this may take a while depending on your cpu(s)...
ruby-1.9.3-p547 - #downloading ruby-1.9.3-p547, this may take a while depending on your connection...
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 9801k 100 9801k 0 0 170k 0 0:00:57 0:00:57 --:--:-- 120k
ruby-1.9.3-p547 - #extracting ruby-1.9.3-p547 to /Users/Jones/.rvm/src/ruby-1.9.3-p547....
ruby-1.9.3-p547 - #applying patch /Users/Jones/.rvm/patches/ruby/GH-488.patch.
ruby-1.9.3-p547 - #configuring.
Error running './configure --prefix=/Users/Jones/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared',
showing last 15 lines of /Users/Jones/.rvm/log/1404502752_ruby-1.9.3-p547/configure.log
[2014-07-04 13:16:23] ./configure
current path: /Users/Jones/.rvm/src/ruby-1.9.3-p547
GEM_HOME=/Users/Jones/.rvm/gems/ruby-2.1.2
PATH=/usr/local/opt/gcc46/bin:/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/Users/Jones/.rvm/gems/ruby-2.1.2/bin:/Users/Jones/.rvm/gems/ruby-2.1.2@global/bin:/Users/Jones/.rvm/rubies/ruby-2.1.2/bin:/Library/Frameworks/Python.framework/Versions/3.4/bin:/Users/Jones/Library/Enthought/Canopy_64bit/User/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin:/Users/Jones/.rvm/bin
GEM_PATH=/Users/Jones/.rvm/gems/ruby-2.1.2:/Users/Jones/.rvm/gems/ruby-2.1.2@global
command(7): ./configure --prefix=/Users/Jones/.rvm/rubies/ruby-1.9.3-p547 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --without-tcl --without-tk --disable-install-doc --enable-shared
configure: WARNING: unrecognized options: --without-tcl, --without-tk
checking build system type... i386-apple-darwin13.3.0
checking host system type... i386-apple-darwin13.3.0
checking target system type... i386-apple-darwin13.3.0
checking whether the C compiler works... no
configure: error: in `/Users/Jones/.rvm/src/ruby-1.9.3-p547':
configure: error: C compiler cannot create executables
See `config.log' for more details
There has been an error while running configure. Halting the installation.
回答1:
Error: No available formula for gcc46
Try:
rvm install 1.9.3 --with-gcc=clang
Or install xcode:
xcode-select --install
回答2:
The solution that finally worked for me on Mac OS X Mavericks 10.9.4:
rvm pkg install openssl
CC=/usr/local/bin/gcc-4.2 CPP=/usr/local/bin/cpp-4.2 CXX=/usr/local/bin/g++-4.2 rvm install 1.9.3 --with-openssl-dir=$rvm_path/usr
Ruby 1.9.3 appears to only compile with GCC 4.2. I could not get it to compile with 4.9.
来源:https://stackoverflow.com/questions/24569954/trouble-installing-ruby-1-9-3-on-mac-osx-10-9-4