I stumbled upon this issue when trying to compile dev-ruby/ffi-1.9.6-r2 on 5/10/2017. dev-ruby/rake is not defined as a dependency for dev-ruby/ffi yet it won't compile without it. https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-ruby/ffi/ffi-1.9.6-r2.ebuild each_ruby_compile() { emake -Cext/ffi_c V=1 cp ext/ffi_c/ffi_c.so lib/ || die ${RUBY} -S rake -f gen/Rakefile || die "types.conf generation failed" } especially this part: ${RUBY} -S rake -f gen/Rakefile -S looks for a rake script in PATH, it won't find it if it's not installed.
Fixed by adding a built-time dependency on dev-ruby/rake. Thanks for reporting.