为什么在 ubuntu 11.04 上使用 rvm 安装 Ruby 1.9.3 时出现错误?

发布于 2024-12-26 12:49:39 字数 3105 浏览 1 评论 0原文

我没有通过 rvm 在系统上安装 Rubies:

~ % rvm list
rvm rubies

我在系统上安装了 1.8.7:

~ % which ruby
/usr/bin/ruby
~ % ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]

尝试使用 RVM 安装 1.9.3 时出现以下错误:

% rvm install 1.9.3
ERROR: Error running ' ./configure
 --prefix=/home/omni/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc  --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-libyaml-dir=/home/omni/.rvm/usr ', please read /home/omni/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.

configure.log 显示:

[2012-01-13 21:09:17]  ./configure
--prefix=/home/omni/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc  --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-libyaml-dir=/home/omni/.rvm/usr  
configure: WARNING: unrecognized options: --with-libyaml-dir 

checking build system type...
i686-pc-linux-gnu 

checking host system type... i686-pc-linux-gnu

checking target system type... i686-pc-linux-gnu 

checking whether the C compiler works... no 

configure: error: in
`/home/omni/.rvm/src/ruby-1.9.3-p0': configure: error: C compiler
cannot create executables See `config.log' for more details

我尝试过使用 --with-gcc=clang 标志运行:

~ % rvm install 1.9.3 --with-gcc=clang

ERROR: Error running '
./configure --prefix=/home/omni/.rvm/rubies/ruby-1.9.3-p0
--enable-shared --disable-install-doc  --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-libyaml-dir=/home/omni/.rvm/usr ', please read /home/omni/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has
been an error while running configure. Halting the installation.

我的 gcc 版本是:

~ % gcc -v 

Using built-in specs. 

COLLECT_GCC=gcc 

COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper


Target: i686-linux-gnu 

Configured with: ../src/configure -v
--with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu 

Thread model: posix 

gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)

我已经研究了很长时间但找不到解决方案。

I have no Rubies install on the system through rvm:

~ % rvm list
rvm rubies

I have 1.8.7 installed on the system:

~ % which ruby
/usr/bin/ruby
~ % ruby -v
ruby 1.8.7 (2010-08-16 patchlevel 302) [i686-linux]

While trying to install 1.9.3 using RVM I got the following errors:

% rvm install 1.9.3
ERROR: Error running ' ./configure
 --prefix=/home/omni/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc  --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-libyaml-dir=/home/omni/.rvm/usr ', please read /home/omni/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has been an error while running configure. Halting the installation.

configure.log shows:

[2012-01-13 21:09:17]  ./configure
--prefix=/home/omni/.rvm/rubies/ruby-1.9.3-p0 --enable-shared --disable-install-doc  --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-libyaml-dir=/home/omni/.rvm/usr  
configure: WARNING: unrecognized options: --with-libyaml-dir 

checking build system type...
i686-pc-linux-gnu 

checking host system type... i686-pc-linux-gnu

checking target system type... i686-pc-linux-gnu 

checking whether the C compiler works... no 

configure: error: in
`/home/omni/.rvm/src/ruby-1.9.3-p0': configure: error: C compiler
cannot create executables See `config.log' for more details

I tried running with --with-gcc=clang flag:

~ % rvm install 1.9.3 --with-gcc=clang

ERROR: Error running '
./configure --prefix=/home/omni/.rvm/rubies/ruby-1.9.3-p0
--enable-shared --disable-install-doc  --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-gcc=clang --with-libyaml-dir=/home/omni/.rvm/usr ', please read /home/omni/.rvm/log/ruby-1.9.3-p0/configure.log ERROR: There has
been an error while running configure. Halting the installation.

My gcc version is:

~ % gcc -v 

Using built-in specs. 

COLLECT_GCC=gcc 

COLLECT_LTO_WRAPPER=/usr/lib/i386-linux-gnu/gcc/i686-linux-gnu/4.5.2/lto-wrapper


Target: i686-linux-gnu 

Configured with: ../src/configure -v
--with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=i386-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/i386-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/i386-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=i686-linux-gnu --host=i686-linux-gnu --target=i686-linux-gnu 

Thread model: posix 

gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4)

I've been at it for a long time and can't find a solution.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

机场等船 2025-01-02 12:49:39

您是否尝试过按照rvm依赖项给出的指示进行操作?

Have you tried following the directions given by rvm dependencies?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文