views:

369

answers:

3

Hi,

I just updated to use rails 3 and tried my first project with rails 3.

When I run my cucumber specs then I get following strange warnings

/home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string

/home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string

/home/ubuntu/.rvm/gems/ruby-1.9.2-p0/gems/rack-1.2.1/lib/rack/utils.rb:16: warning: regexp match /.../n against to UTF-8 string

I am using rvm with ruby 1.9.2-p0

my bundle contains following gems...

Using rake (0.8.7) 
Using abstract (1.0.0) 
Using activesupport (3.0.0) 
Using builder (2.1.2) 
Using i18n (0.4.1) 
Using activemodel (3.0.0) 
Using erubis (2.6.6) 
Using rack (1.2.1) 
Using rack-mount (0.6.13) 
Using rack-test (0.5.4) 
Using tzinfo (0.3.23) 
Using actionpack (3.0.0) 
Using mime-types (1.16) 
Using polyglot (0.3.1) 
Using treetop (1.4.8) 
Using mail (2.2.5) 
Using actionmailer (3.0.0) 
Using arel (1.0.1) 
Using activerecord (3.0.0) 
Using activeresource (3.0.0) 
Using bundler (1.0.0) 
Using culerity (0.2.12) 
Using nokogiri (1.4.3.1) 
Using ffi (0.6.3) 
Using json_pure (1.4.6) 
Using rubyzip (0.9.4) 
Using selenium-webdriver (0.0.28) 
Using capybara (0.3.9) 
Using configuration (1.1.0) 
Using diff-lcs (1.1.2) 
Using trollop (1.16.2) 
Using gherkin (2.1.5) 
Using term-ansicolor (1.0.5) 
Using cucumber (0.8.5) 
Using cucumber-rails (0.3.2) 
Using database_cleaner (0.5.2) 
Using launchy (0.3.7) 
Using mysql2 (0.2.3) 
Using rspec-core (2.0.0.beta.20) 
Using rspec-expectations (2.0.0.beta.20) 
Using rspec-mocks (2.0.0.beta.20) 
Using rspec (2.0.0.beta.20) 
Using yard (0.6.0) 
Using pickle (0.4.2) 
Using thor (0.14.0) 
Using railties (3.0.0) 
Using rails (3.0.0) 
Using rspec-rails (2.0.0.beta.20) 
Using spork (0.8.4) 
Using webrat (0.7.1) 

does anyone know how to get rid of these warnings? And where they are coming from?

A: 

Maybe your scripts are encoded in ASCII or a different format from UTF-8?

Jorge Israel Peña
What does this mean? Can you provide some details? Is it my editor which needs to treat files as UTF-8? Because the warning comes from Rack as far as I can guess...
server info
+1  A: 

Add this to a file in features/support or put it in the env.rb file:

# Stop endless errors like
# ~/.rvm/gems/ruby-1.9.2-p0@global/gems/rack-1.2.1/lib/rack/utils.rb:16: 
# warning: regexp match /.../n against to UTF-8 string
$VERBOSE = nil

This will suppress those warnings, though I am not sure what is causing them in the first place. I am getting them, also

bjeanes
+3  A: 

There is a gem called "escape_utils" that takes care of this problem. Here is the link to an article explaining the problem.

hjuskewycz