0

After upgrading recently to brakeman 3.3.5 I am getting a similar exception on two files. One is app/helpers/profile_mailer and the exception is

golf_mentor/app/helpers/profile_helper.rb:1 :: parse error on value ":" (tCOLON)

If I delete everything but the surrounding block, so the file becomes

module ProfilesHelper

end

I still get the same exception. If I delete everything in the file, I get the following exception:

undefined method `force_encoding' for nil:NilClass While processing app/helpers/profiles_helper.rb

Looking on stackoverflow, such an error is not reported for brakeman, but it appears to be reported for a number of other apps and is related to ruby 2.2 (I am running 2.2.1).

The file permissions for this file are

-rw-r--r--  1 Chris  staff     4 16 Aug 19:57 profiles_helper.rb

How do I fix this?

Obromios
  • 15,408
  • 15
  • 72
  • 127
  • I can't reproduce either issue. Please run Brakeman with `-d` and share the full stack traces related to the exceptions. – Justin Aug 16 '16 at 15:14
  • The full stack trace is here: https://github.com/obromios/stack_overflow_queries/blob/master/brakeman_output.txt – Obromios Aug 16 '16 at 23:42
  • Thank you, but the relevant information is actually before the report and is output to stderr. Something like `brakeman -d &> out.txt`. In any case, this is bound to be a RubyParser issue, probably lack of support for some syntax. What is confusing is the empty file case. – Justin Aug 22 '16 at 16:16

0 Answers0