diff --git a/bin/ruby-build b/bin/ruby-build index 3bc6cb2f..0ce0b709 100755 --- a/bin/ruby-build +++ b/bin/ruby-build @@ -592,7 +592,9 @@ fix_rbx_gem_binstubs() { for file in "$gemdir"/*; do binstub="${bindir}/${file##*/}" rm -f "$binstub" - sed -E "s:^#\!.+:#\!${bindir}/ruby:" < "$file" > "$binstub" + { echo "#!${bindir}/ruby" + cat "$file" + } > "$binstub" chmod +x "$binstub" done rm -rf "$gemdir" diff --git a/test/build.bats b/test/build.bats index 1900057c..f9650736 100644 --- a/test/build.bats +++ b/test/build.bats @@ -386,6 +386,57 @@ bundle exec rake install OUT } +@test "fixes rbx binstubs" { + executable "${RUBY_BUILD_CACHE_PATH}/rubinius-2.0.0/gems/bin/rake" <>' +OUT + cached_tarball "rubinius-2.0.0" bin/ruby + + stub bundle '--version : echo 1' true + stub rake \ + '--version : echo 1' \ + "install : mkdir -p '$INSTALL_ROOT'; cp -fR . '$INSTALL_ROOT'" + + run_inline_definition <>' +OUT +} + @test "JRuby build" { executable "${RUBY_BUILD_CACHE_PATH}/jruby-1.7.9/bin/jruby" <