Skip to content


stop erubis from printing its version number all the time #1

merged 2 commits into from

3 participants


(please release as patch so I can get rid of this git-gem dependency)


@joloudov If you want to save the work simply add me to rubygems/github and I'll do it myself :)

@joloudov joloudov merged commit 51bc0bf into joloudov:master

Thanks guys, this output was so annoying!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Showing with 8 additions and 2 deletions.
  1. +7 −1 lib/rails_xss/erubis.rb
  2. +1 −1 rails/init.rb
8 lib/rails_xss/erubis.rb
@@ -1,4 +1,10 @@
-require 'erubis/helpers/rails_helper'
+# stop erubis from printing it's version number all the time
+old_stdout = $stdout"/dev/null", "w") do |f|
+ $stdout = f
+ require 'erubis/helpers/rails_helper'
+ $stdout = old_stdout
module RailsXss
class Erubis < ::Erubis::Eruby
2 rails/init.rb
@@ -1,5 +1,5 @@
unless $gems_rake_task
- if Rails.version <= "2.3.7"
+ if <="2.3.7")
$stderr.puts "rails_xss requires Rails 2.3.8 or later. Please upgrade to enable automatic HTML safety."
require 'rails_xss'
Something went wrong with that request. Please try again.