diff --git a/lib/sprockets/rails/legacy_asset_url_helper.rb b/lib/sprockets/rails/legacy_asset_url_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/sprockets/rails/legacy_asset_url_helper.rb
+++ b/lib/sprockets/rails/legacy_asset_url_helper.rb
@@ -21,8 +21,7 @@ module Sprockets
           source = compute_asset_path(source, options)
         end
 
-        relative_url_root = (defined?(config.relative_url_root) && config.relative_url_root) ||
-          (respond_to?(:request) && request.try(:script_name))
+        relative_url_root = defined?(config.relative_url_root) && config.relative_url_root
         if relative_url_root
           source = "#{relative_url_root}#{source}" unless source.starts_with?("#{relative_url_root}/")
         end
backporting fix to rails/rails#<I> from
<URL>