新手问题 用 RVM 安装 ruby-2.2.0 出错

775343518 · 2015年10月28日 · 最后由 yangon 回复于 2015年10月31日 · 9407 次阅读

我是在虚拟机里 CentOS5.6 下用 RVM 安装 ruby 2.2.0,出现了这些问题,错误代码如下

[775343518@localhost cache]$ rvm reinstall ruby-2.2.0
ruby-2.2.0 - #removing src/ruby-2.2.0..
ruby-2.2.0 - #removing rubies/ruby-2.2.0..
Searching for binary rubies, this might take some time.
No binary rubies available for: centos/6/i386/ruby-2.2.0.
Continuing with compilation. Please read 'rvm help mount' to get more information on binary rubies.
Installing Ruby from source to: /home/775343518/.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 /home/775343518/.rvm/src/ruby-2.2.0....
ruby-2.2.0 - #applying patch /home/775343518/.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...............................
Error running '__rvm_make install',
showing last 15 lines of /home/775343518/.rvm/log/1446032996_ruby-2.2.0/install.log
    from /home/775343518/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/775343518/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/775343518/.rvm/src/ruby-2.2.0/lib/rubygems/dependency_installer.rb:3:in `<top (required)>'
    from /home/775343518/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/775343518/.rvm/src/ruby-2.2.0/lib/rubygems/core_ext/kernel_require.rb:54:in `require'
    from /home/775343518/.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] 错误 1
++ return 2
There has been an error while running make install. Halting the installation.

=================================================================================================== 用 ruby -v 提示没有此命令,ruby list 却显示有 [775343518@localhost cache]$ rvm list

rvm rubies

ruby-2.2.0 [ i686 ]

Default ruby not set. Try 'rvm alias create default '.

=> - current

=* - current && default

* - default

这个错误我从没有碰到过。在终端中执行 rvm requirements 会列出一堆的依赖,都安装了吗?

下次记得给代码排版,语法:

```bash

```

编译已经完成。install 出错?

从源码编译安装


nice ./configure --prefix=/opt/ruby --disable-install-doc && nice make -j3
nice make install && nice make test
export PATH="/opt/ruby/bin:$PATH" # 要加入 .bashrc 
#sudo ln -s /opt/ruby/bin/ruby /usr/bin/ruby -f
sudo setcap cap_net_bind_service=+ep `which ruby`


直接

rvm use 2.2.0

直接把 .rvm 目录删了重装呢?

也可以试试 rbenv

我也出过这个错

需要 登录 后方可回复, 如果你还没有账号请 注册新账号