【问题标题】:Error while installing ruby version 2.2.5安装 ruby​​ 版本 2.2.5 时出错
【发布时间】:2016-11-03 18:16:12
【问题描述】:

当我执行rvm install ruby-2.2.5 时,我遇到了错误。知道为什么吗?

M1620661:Wellness_service us044466$ rvm install ruby-2.2.5
ruby-2.2.5 - #removing src/ruby-2.2.5..
Searching for binary rubies, this might take some time.
Found remote file https://rvm_io.global.ssl.fastly.net/binaries/osx/10.11/x86_64/ruby-2.2.5.tar.bz2
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
ruby-2.2.5 - #configure
ruby-2.2.5 - #download
ruby-2.2.5 - #validate archive
ruby-2.2.5 - #extract
ruby-2.2.5 - #validate binary
Libraries missing for ruby-2.2.5: /usr/local/opt/gmp/lib/libgmp.10.dylib. Refer to your system manual for installing libraries
Mounting remote ruby failed with status 10, trying to compile.
Checking requirements for osx.
Certificates in '/usr/local/etc/openssl/cert.pem' are already up to date.
Requirements installation successful.
Warning: found user selected compiler '/usr/local/opt/apple-gcc42/bin/gcc-4.2', this will suppress RVM auto detection mechanisms.
Installing Ruby from source to: /Users/us044466/.rvm/rubies/ruby-2.2.5, this may take a while depending on your cpu(s)...
ruby-2.2.5 - #downloading ruby-2.2.5, this may take a while depending on your connection...
ruby-2.2.5 - #extracting ruby-2.2.5 to /Users/us044466/.rvm/src/ruby-2.2.5....
ruby-2.2.5 - #configuring......
Error running './configure --prefix=/Users/us044466/.rvm/rubies/ruby-2.2.5 --with-opt-dir=/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl:/usr/local/opt/libyaml:/usr/local/opt/readline:/usr/local/opt/libksba:/usr/local/opt/openssl --disable-install-doc --enable-shared',
showing last 15 lines of /Users/us044466/.rvm/log/1478196378_ruby-2.2.5/configure.log
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking minix/config.h usability... no
checking minix/config.h presence... no
checking for minix/config.h... no
checking whether it is safe to define __EXTENSIONS__... yes
checking for cd using physical directory... cd -P
checking whether CFLAGS is valid... no
configure: error: something wrong with CFLAGS="-g -O2 "
There has been an error while running configure. Halting the installation.

【问题讨论】:

  • 你需要2.2.5吗?为什么不试试 2.3.1?
  • 我克隆了一个 repo,当我进行捆绑安装时,我收到错误 ruby​​_dep-1.5.0 requires ruby​​ version >= 2.2.5, ~> 2.2,它与当前版本 ruby​​ 2.0 不兼容.0p648
  • 嗯,2.3.1 符合这些要求,并且可能已经解决了您在这里遇到的问题。看起来您缺少 libgmp 库,通常 RVM 非常适合排列这些依赖项。

标签: ruby-on-rails ruby ruby-on-rails-3 rvm


【解决方案1】:

这个很有魅力

rvm install 2.2.5 --with-gcc=clang  

【讨论】:

    【解决方案2】:

    你在这里没有给我们太多信息。你在运行什么操作系统?哪个版本?
    根据this issue on the Ruby GitHub page,您可以通过使用 GCC 安装来解决此问题:CC=/usr/bin/gcc rvm install ruby-2.2.5,假设您已将 GCC 安装到/usr/bin/gcc

    【讨论】:

    • 这不是真正的答案。
    猜你喜欢
    • 1970-01-01
    • 2021-09-14
    • 2021-10-17
    • 1970-01-01
    • 2013-03-20
    • 1970-01-01
    • 1970-01-01
    • 2016-06-05
    • 2021-05-03
    相关资源
    最近更新 更多