Skip to content

undefined method `blame_file!' #976

@TheKidCoder

Description

@TheKidCoder

I have a Rails 4 app that runs great on jRuby 1.7.3.

Today I tried giving 1.7.4 a try and came across an interesting error when trying to boot the rails app using Puma.

NoMethodError: undefined method `blame_file!' for java.lang.NullPointerException:Java::JavaLang::NullPointerException
                         load_dependency at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:216
                         load_dependency at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213
                                    load at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:222
                                  Engine at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/engine.rb:609
                                    each at org/jruby/RubyArray.java:1617
                                  Engine at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/engine.rb:608
                           instance_exec at org/jruby/RubyBasicObject.java:1764
                                     run at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/initializable.rb:30
                        run_initializers at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/initializable.rb:55
                              tsort_each at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:150
       each_strongly_connected_component at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:183
  each_strongly_connected_component_from at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:210
  each_strongly_connected_component_from at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:219
  each_strongly_connected_component_from at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:208
                                    each at org/jruby/RubyArray.java:1617
                        tsort_each_child at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/initializable.rb:44
  each_strongly_connected_component_from at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:203
       each_strongly_connected_component at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:182
                                    each at org/jruby/RubyArray.java:1617
       each_strongly_connected_component at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:180
                              tsort_each at /Users/chris/.rvm/rubies/jruby-1.7.4/lib/ruby/1.9/tsort.rb:148
                        run_initializers at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/initializable.rb:54
                             initialize! at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/application.rb:215
                                __send__ at org/jruby/RubyBasicObject.java:1703
                                    send at org/jruby/RubyKernel.java:2209
                          method_missing at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/railtie/configurable.rb:30
                                  (root) at /Volumes/HD/Media/Function/ClientProjects/RepPro/Development/RepPro/config/environment.rb:5
                                 require at org/jruby/RubyKernel.java:1054
                                 require at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228
                         load_dependency at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:213
                                 require at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/activesupport-4.0.0/lib/active_support/dependencies.rb:228
                                  (root) at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/application.rb:1
                    require_environment! at /Users/chris/.rvm/gems/jruby-1.7.4@RepPro/gems/railties-4.0.0/lib/rails/application.rb:189
                                 require at org/jruby/RubyKernel.java:1054
                                  (root) at bin/rails:4

I added an initializer:

class Exception
  def blame_file!( file )
    puts "CULPRIT >> '#{file.to_s}' # #{self.to_s}"
  end
end

To see what the issue was and it looks like rails was trying to load some helpers I had removed. I added the helpers back and am still getting the blame_file error. There is not problem with this when I go back to 1.7.3.

RVM info:

ruby:
    interpreter:  "jruby"
    version:      "1.7.4"
    date:         "jruby 1.7.4 (2.0.0dev) 2013-02-21 dac429b on Java HotSpot(TM) Client VM 1.6.0_51-b11-457-11M4509 [darwin-i386]"
    platform:     "darwin-i386"
    patchlevel:   "TM"
    full_version: "jruby 1.7.4 (2.0.0dev) 2013-02-21 dac429b on Java HotSpot(TM) Client VM 1.6.0_51-b11-457-11M4509 [darwin-i386]"

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions