使用rvm安装Ruby 2.2.0时出错

时间:2015-01-31 23:05:38

标签: ruby install rvm osx-yosemite

我正在使用OSX 10.10.2。

我尝试使用rvm将Ruby从2.1.5更新到2.2.0。这导致了一些错误,这使我无法解决Ruby和rvm的问题。

最终,我使用rvm implode完全卸载了rvm。这没有用,我被指示手动删除〜/ .rvm。我这样做并重新安装了Ruby 2.2.0打包的rvm。 rvm安装成功了。尝试安装Ruby 2.2.0时,安装会一直失败。

有关如何解决此错误的任何想法?

终端输出:

Alexs-MacBook-Pro:~ Alex$ rvm --debug install 2.2
ruby-2.2.0 - install
ruby-2.2.0 - #already removed src/ruby-2.2.0
ruby-2.2.0 - #already removed rubies/ruby-2.2.0
Searching for binary rubies, this might take some time.
Remote file does not exist https://rvm_io.global.ssl.fastly.net/binaries/osx/10.10/x86_64/ruby-2.2.0.tar.bz2
Remote file does not exist https://s3.amazonaws.com/jruby.org/downloads/ruby-2.2.0.tar.bz2
Remote file does not exist http://binaries.rubini.us/osx/10.10/x86_64/ruby-2.2.0.tar.bz2
Remote file does not exist https://rubies.travis-ci.org/osx/10.10/x86_64/ruby-2.2.0.tar.bz2
rvm_remote_server_url4 not found
No remote file name found
Remote file does not exist https://rvm_io.global.ssl.fastly.net/binaries/osx/10.10/x86_64/ruby-2.2.0.tar.bz2
Remote file does not exist https://s3.amazonaws.com/jruby.org/downloads/ruby-2.2.0.tar.bz2
Remote file does not exist http://binaries.rubini.us/osx/10.10/x86_64/ruby-2.2.0.tar.bz2
Remote file does not exist https://rubies.travis-ci.org/osx/10.10/x86_64/ruby-2.2.0.tar.bz2
rvm_remote_server_url4 not found
No remote file name found
No binary rubies available for: osx/10.10/x86_64/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Free disk space 22323MB, required 440MB.
__rvm_setup_compile_environment_setup ruby-2.2.0
rvm_autolibs_flag=4
__rvm_setup_compile_environment_movable_early ruby-2.2.0
__rvm_setup_compile_environment_system_early ruby-2.2.0
__rvm_setup_compile_environment_requirements ruby-2.2.0
Checking requirements for osx.
requirements code for osx loaded
requirements lib type set to osx_brew
brew seems to be writable
Found required packages: autoconf, automake, libtool, pkg-config, libyaml, readline, libksba, openssl.
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/libyaml )
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/readline )
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/libksba )
rvm_configure_flags+=( --with-opt-dir=/usr/local/opt/openssl )
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
__rvm_setup_compile_environment_movable ruby-2.2.0
__rvm_setup_compile_environment_parse_name ruby-2.2.0
__rvm_setup_compile_environment_system ruby-2.2.0
__rvm_setup_compile_environment_architectures ruby-2.2.0
rvm_architectures(0):.
__rvm_setup_compile_environment_gcc47plus ruby-2.2.0
__rvm_setup_compile_environment_bison ruby-2.2.0
__rvm_setup_compile_environment_flags_docs ruby-2.2.0
__rvm_setup_compile_environment_flags_shared_static ruby-2.2.0
__rvm_setup_compile_environment_flags_threads ruby-2.2.0
__rvm_setup_compile_environment_compatibility_flag ruby-2.2.0
found compiler: gcc
Installing Ruby from source to: /Users/Alex/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
fetch http://cache.ruby-lang.org/pub/ruby/2.2/ruby-2.2.0.tar.bz2 => ruby-2.2.0.tar.bz2
Archive checksum matched, not downloading
Downloaded archive checksum matched.
Log prefix: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/
Log filesystem: local,
Log max name length: 250
Log file: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/extract.log
[2015-01-31 18:22:09] __rvm_package_extract
__rvm_package_extract () 
{ 
    rvm_debug __rvm_package_extract:$#: "$@";
    \typeset __tempdir __path __file __return;
    __return=0;
    __tempdir="$( TMPDIR="${rvm_tmp_path}" mktemp -d -t rvm-tmp.XXXXXXXXX )";
    __rvm_package_extract_run "$1" "$__tempdir" || __return=$?;
    if (( __return == 0 )); then
        for __path in "$__tempdir"/*;
        do
            __file="${__path##*/}";
            if [[ -n "${__file}" && -e "$2/${__file}" ]]; then
                \command \rm -rf "$2/${__file}" || __return=$?;
            fi;
            \command \mv -f "${__path}" "$2/" || __return=$?;
        done;
    fi;
    if [[ -n "$__tempdir" ]]; then
        \command \rm -rf "$__tempdir";
    fi;
    return $__return
}
current path: /Users/Alex/.rvm/src
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
command(3): __rvm_package_extract /Users/Alex/.rvm/archives/ruby-2.2.0.tar.bz2 /Users/Alex/.rvm/tmp/rvm_src_21941
ruby-2.2.0 - #extracting ruby-2.2.0 to /Users/Alex/.rvm/src/ruby-2.2.0.....
__rvm_rm_rf already gone: /Users/Alex/.rvm/src/ruby-2.2.0
Patch name 'optional', expanded_name(s) ''.
Patch name 'default', expanded_name(s) 'fix_installing_bundled_gems'.
Patch name 'osx', expanded_name(s) ''.
All found patches(1): fix_installing_bundled_gems.
Patch full path '/Users/Alex/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch'.
Log file: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/patch.apply.fix_installing_bundled_gems.log
[2015-01-31 18:22:12] __rvm_patch
__rvm_patch () 
{ 
    \patch "$@" || return $?
}
current path: /Users/Alex/.rvm/src/ruby-2.2.0
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
command(8): __rvm_patch -F 25 -p1 -N -f -i /Users/Alex/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch
ruby-2.2.0 - #applying patch /Users/Alex/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch.
Log file: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/configure.log
[2015-01-31 18:22:12] ./configure
current path: /Users/Alex/.rvm/src/ruby-2.2.0
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
command(5): ./configure --prefix=/Users/Alex/.rvm/rubies/ruby-2.2.0 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared
ruby-2.2.0 - #configuring..........................................................
Log file: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/postconfigure.log
[2015-01-31 18:22:38] __rvm_post_configure_ruby
__rvm_post_configure_ruby () 
{ 
    __rvm_post_configure_ruby_fix_athlon_sse2;
    __rvm_post_configure_ruby_update_setup
}
current path: /Users/Alex/.rvm/src/ruby-2.2.0
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
command(1): __rvm_post_configure_ruby
ruby-2.2.0 - #post-configuration.
Log file: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/make.log
[2015-01-31 18:22:38] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /Users/Alex/.rvm/src/ruby-2.2.0
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
command(3): __rvm_make -j 1
ruby-2.2.0 - #compiling.............................................................
__rvm_rm_rf already gone: /Users/Alex/.rvm/src/ruby-2.2.0/.ext/rdoc
Log file: /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/install.log
[2015-01-31 18:24:30] __rvm_make
__rvm_make () 
{ 
    \make "$@" || return $?
}
current path: /Users/Alex/.rvm/src/ruby-2.2.0
PATH=/usr/local/opt/pkg-config/bin:/usr/local/opt/libtool/bin:/usr/local/opt/automake/bin:/usr/local/opt/autoconf/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/usr/local/git/bin:/Users/Alex/.rvm/bin
command(2): __rvm_make install
ruby-2.2.0 - #installing...........
Error running '__rvm_make install',
showing last 15 lines of /Users/Alex/.rvm/log/1422746529_ruby-2.2.0/install.log
    from /Users/Alex/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Alex/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Alex/.rvm/src/ruby-2.2.0/lib/rubygems/dependency_installer.rb:3:in `<top (required)>'
    from /Users/Alex/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Alex/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /Users/Alex/.rvm/src/ruby-2.2.0/lib/rubygems.rb:556:in `install'
    from ./tool/rbinstall.rb:717:in `block (2 levels) in <main>'
    from ./tool/rbinstall.rb:716:in `each'
    from ./tool/rbinstall.rb:716:in `block in <main>'
    from ./tool/rbinstall.rb:749:in `call'
    from ./tool/rbinstall.rb:749:in `block in <main>'
    from ./tool/rbinstall.rb:746:in `each'
    from ./tool/rbinstall.rb:746:in `<main>'
make: *** [do-install-nodoc] Error 1
++ return 2
There has been an error while running make install. Halting the installation.
__rvm_rm_rf already gone: /Users/Alex/.rvm/tmp/21941*
Alexs-MacBook-Pro:~ Alex$ 

1 个答案:

答案 0 :(得分:0)

固定!跑brew doctor,发现一个没有链接的小桶......

Alexs-MacBook-Pro:~ Alex$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Your XQuartz (2.7.4) is outdated
Please install XQuartz 2.7.7:
  https://xquartz.macosforge.org

Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected dylibs:
    /usr/local/lib/libatk-1.0.0.2209.1.dylib
    /usr/local/lib/libgdk-x11-2.0.0.1200.0.dylib
    /usr/local/lib/libgdk_pixbuf-2.0.0.1200.0.dylib
    /usr/local/lib/libgdk_pixbuf_xlib-2.0.0.1200.0.dylib
    /usr/local/lib/libgio-2.0.0.0.0.dylib
    /usr/local/lib/libGLEW.1.5.4.dylib
    /usr/local/lib/libglib-2.0.0.1600.0.dylib
    /usr/local/lib/libgmodule-2.0.0.1600.0.dylib
    /usr/local/lib/libgobject-2.0.0.1600.0.dylib
    /usr/local/lib/libgthread-2.0.0.1600.0.dylib
    /usr/local/lib/libgtk-x11-2.0.0.1200.0.dylib
    /usr/local/lib/libintl.8.0.2.dylib
    /usr/local/lib/libjpeg.62.dylib
    /usr/local/lib/libpango-1.0.0.2100.0.dylib
    /usr/local/lib/libpangocairo-1.0.0.2100.0.dylib
    /usr/local/lib/libpangoft2-1.0.0.2100.0.dylib
    /usr/local/lib/libpangox-1.0.0.2100.0.dylib
    /usr/local/lib/libpangoxft-1.0.0.2100.0.dylib
    /usr/local/lib/libportaudio.2.0.0.dylib
    /usr/local/lib/libSDL-1.2.0.dylib
    /usr/local/lib/libz.1.2.5.dylib

Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected header files:
    /usr/local/include/node/ares.h
    /usr/local/include/node/ares_version.h
    /usr/local/include/node/nameser.h
    /usr/local/include/node/node.h
    /usr/local/include/node/node_buffer.h
    /usr/local/include/node/node_internals.h
    /usr/local/include/node/node_object_wrap.h
    /usr/local/include/node/node_version.h
    /usr/local/include/node/openssl/opensslconf.h
    /usr/local/include/node/uv-private/ngx-queue.h
    /usr/local/include/node/uv-private/stdint-msvc2008.h
    /usr/local/include/node/uv-private/tree.h
    /usr/local/include/node/uv-private/uv-bsd.h
    /usr/local/include/node/uv-private/uv-darwin.h
    /usr/local/include/node/uv-private/uv-linux.h
    /usr/local/include/node/uv-private/uv-sunos.h
    /usr/local/include/node/uv-private/uv-unix.h
    /usr/local/include/node/uv-private/uv-win.h
    /usr/local/include/node/uv.h
    /usr/local/include/node/v8-debug.h
    /usr/local/include/node/v8-preparser.h
    /usr/local/include/node/v8-profiler.h
    /usr/local/include/node/v8-testing.h
    /usr/local/include/node/v8.h
    /usr/local/include/node/v8stdint.h
    /usr/local/include/node/zconf.h
    /usr/local/include/node/zlib.h

Warning: Unbrewed .la files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected .la files:
    /usr/local/lib/libatk-1.0.la
    /usr/local/lib/libgdk-x11-2.0.la
    /usr/local/lib/libgdk_pixbuf-2.0.la
    /usr/local/lib/libgdk_pixbuf_xlib-2.0.la
    /usr/local/lib/libgio-2.0.la
    /usr/local/lib/libglib-2.0.la
    /usr/local/lib/libgmodule-2.0.la
    /usr/local/lib/libgobject-2.0.la
    /usr/local/lib/libgthread-2.0.la
    /usr/local/lib/libgtk-x11-2.0.la
    /usr/local/lib/libintl.la
    /usr/local/lib/libjpeg.la
    /usr/local/lib/libpango-1.0.la
    /usr/local/lib/libpangocairo-1.0.la
    /usr/local/lib/libpangoft2-1.0.la
    /usr/local/lib/libpangox-1.0.la
    /usr/local/lib/libpangoxft-1.0.la
    /usr/local/lib/libportaudio.la

Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.

Unexpected static libraries:
    /usr/local/lib/libGLEW.a
    /usr/local/lib/libintl.a
    /usr/local/lib/libjpeg.a
    /usr/local/lib/libportaudio.a
    /usr/local/lib/libz.a

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

    node
Alexs-MacBook-Pro:~ Alex$

然后我尝试运行brew link node来修复未关联的小桶......

Alexs-MacBook-Pro:~ Alex$ brew link node
Linking /usr/local/Cellar/node/0.10.30... 
Error: Could not symlink bin/node
Target /usr/local/bin/node
already exists. You may want to remove it:
  rm '/usr/local/bin/node'

To force the link and overwrite all conflicting files:
  brew link --overwrite node

To list all files that would be deleted:
  brew link --overwrite --dry-run node

当尝试仅使用rm '/usr/local/bin/node'删除问题的来源时,再次运行brew link node只是返回了另一个错误,指示我删除另一个文件,所以我决定采用覆盖方法。 ..

Alexs-MacBook-Pro:~ Alex$ brew link --overwrite node
Linking /usr/local/Cellar/node/0.10.30... 33 symlinks created
Alexs-MacBook-Pro:~ Alex$ 

再次运行brew doctor不再显示未关联的小桶。

现在重新安装Ruby 2.2.0 ......

Alexs-MacBook-Pro:~ Alex$  rvm remove 2.2
ruby-2.2.0 - #removing src/ruby-2.2.0..
ruby-2.2.0 - #removing rubies/ruby-2.2.0..
Alexs-MacBook-Pro:~ Alex$  rvm reset
Alexs-MacBook-Pro:~ Alex$  rvm install 2.2
Searching for binary rubies, this might take some time.
No binary rubies available for: osx/10.10/x86_64/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Installing Ruby from source to: /Users/Alex/.rvm/rubies/ruby-2.2.0, this may take a while depending on your cpu(s)...
ruby-2.2.0 - #downloading ruby-2.2.0, this may take a while depending on your connection...
ruby-2.2.0 - #extracting ruby-2.2.0 to /Users/Alex/.rvm/src/ruby-2.2.0....
ruby-2.2.0 - #applying patch /Users/Alex/.rvm/patches/ruby/2.2.0/fix_installing_bundled_gems.patch.
ruby-2.2.0 - #configuring..........................................................
ruby-2.2.0 - #post-configuration.
ruby-2.2.0 - #compiling.............................................................
ruby-2.2.0 - #installing.........
ruby-2.2.0 - #making binaries executable..
Rubygems 2.4.5 already available in installed ruby, skipping installation, use --force to reinstall.
ruby-2.2.0 - #gemset created /Users/Alex/.rvm/gems/ruby-2.2.0@global
ruby-2.2.0 - #importing gemset /Users/Alex/.rvm/gemsets/global.gems...........................................................
ruby-2.2.0 - #generating global wrappers........
ruby-2.2.0 - #gemset created /Users/Alex/.rvm/gems/ruby-2.2.0
ruby-2.2.0 - #importing gemsetfile /Users/Alex/.rvm/gemsets/default.gems evaluated to empty gem list
ruby-2.2.0 - #generating default wrappers........
ruby-2.2.0 - #adjusting #shebangs for (gem irb erb ri rdoc testrb rake).
Install of ruby-2.2.0 - #complete 
Ruby was built without documentation, to build it run: rvm docs generate-ri
Alexs-MacBook-Pro:~ Alex$ 

然后我按照brew doctor最初的指示更新了XQuartz。然而,这是无关紧要的。之后安装文档也很成功。