Open jontonsoup opened 11 years ago
You have a fix for this? I encounter also this problem.
Hmm will look into this soon, thanks for bringing it to my attention. Odd
+1. I do not see the stack trace showing the line numbers in the rabl file.
+1 Seeing the Rabl line numbers could be really helpful.
App log:
INFO Rendered api/v1/foo/bar/index.rabl
INFO Completed 500 Internal Server Error in 1348ms
When I render it manually from the console, I see the error. But I'm still can't see what line number is breaking:
NoMethodError: undefined method `all_activity' for nil:NilClass
from (eval):4:in `block in render'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:79:in `call'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:79:in `node'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:42:in `block in compile_hash'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:41:in `each'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:41:in `compile_hash'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:21:in `block in build'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:156:in `cache_results'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/builder.rb:20:in `build'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/engine.rb:49:in `to_hash'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/engine.rb:61:in `to_json'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/engine.rb:37:in `block in render'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/engine.rb:277:in `cache_results'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/engine.rb:37:in `render'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl/renderer.rb:49:in `render'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/rabl-0.7.10/lib/rabl.rb:73:in `render'
from (irb):108
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /home/foo/bar/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
Anyone interested in helping come up with a pull request for this?
This error happens for all my controllers and views that use rabl (only when there is some sort of error in the file...not during normal use when everything works). The errors in my files can be anything from typos to nil errors, but the same error that is returned to the front end is as follows:
NoMethodError at /api/v1/search_terms/new.json
App backtrace
Full backtrace
This error is pretty useless since it doesn't even show a backtrace in the application stack. I'm using: ruby "1.9.3"
gem 'asset_sync', '0.5.4' gem 'aws-sdk', '1.3.9' gem 'jquery-rails', '2.2.0' gem 'geocoder', '1.1.6' gem 'haml-rails', "~> 0.4" gem 'newrelic_rpm', '3.5.0.1' gem 'pg', '0.14.1' gem 'pg_search', '0.5.7' gem 'possessive', '1.0.1' gem 'spree_social', :git => "git://github.com/spree/spree_social.git", :branch => "1-3-stable" gem 'rails', '3.2.11' gem 'spree', '1.3.2' gem 'spree_auth_devise', :github => "spree/spree_auth_devise", :branch => "1-3-stable" gem 'spree_gateway', :git => 'git://github.com/spree/spree_gateway.git', :branch => "1-3-stable" gem 'spree_print_invoice' , :git => 'git://github.com/Walk-By/spree_print_invoice.git' gem "sunspot_autocomplete", ">= 0.0.3", :git => "git://github.com/xponrails/sunspot_autocomplete.git" gem "sunspot_rails", "~> 2.0.0" gem 'tax_cloud', '0.2.0' gem 'thin', '1.5.0' gem 'urbanairship', '2.2.0' gem 'haml', '3.1.7'
Any intuition on this?
Thanks, Jon