ruby更新报错
2016年04月27日

问题概述

今天更新的时候,发现rdoc更新错误.
错误如下:

* ERROR: dev-ruby/rdoc-4.3.0::gentoo failed (install phase):
* USE Flag 'ruby_targets_ruby22' not in IUSE for dev-ruby/rdoc-4.3.0
* 
* Call stack:
* ebuild.sh, line 115: Called src_install
* environment, line 4456: Called ruby-ng_src_install
* environment, line 4156: Called _ruby_invoke_environment 'all' 'all_ruby_install'
* environment, line 597: Called all_ruby_install
* environment, line 693: Called use 'ruby_targets_ruby22'
* phase-helpers.sh, line 200: Called die
* The specific snippet of code:
* die "USE Flag '${u}' not in IUSE for ${CATEGORY}/${PF}"

查看已安装ruby,结果如下:

eselect ruby list

Available Ruby profiles:
[1] ruby22 *
[2] ruby23 (with Rubygems)

软件源信息如下:

eix -I ruby

[I] dev-lang/ruby
Available versions: 
(2.2) [M]2.2.9 [M]2.2.10
(2.3) 2.3.6 2.3.7
(2.4) ~2.4.3 ~2.4.4
(2.5) ~2.5.0-r1 ~2.5.0-r2 ~2.5.1
{berkdb debug doc examples gdbm ipv6 jemalloc libressl ncurses +rdoc +readline rubytests socks5 ssl static-libs tk xemacs}
Installed versions: 2.3.7(2.3)(05:28:30 PM 04/06/2018)(berkdb gdbm ipv6 ncurses rdoc readline ssl -debug -doc -examples -jemalloc -libressl -rubytests -socks5 -tk -xemacs)
Homepage: http://www.ruby-lang.org/
Description: An object-oriented scripting language

2.2.10 和 2.3.7 已安装,但是2.2被mask.看了下rdoc-4.3.0.ebuild

USE_RUBY="ruby21 ruby22 ruby23"
...
for version in 22 23; do
...

解决办法

去掉22的依赖,重构ebuild

cd /usr/portage/dev-ruby/rdoc 
sed -i 's/[[:alpha:]]*22 //' /usr/portage/dev-ruby/rdoc/rdoc-4.3.0.ebuild 
ebuild rdoc-4.3.0.ebuild digest

如果不着急更新,可以等待官方修复