Rails 4 - Kendo UI ImageBrowser successful upload but undefined thumbnail - image
I am integrating Kendo UI editor with my custom CMS in Rails 4. Everything seems to work except a bug after a new image is uploaded.
After I choose the image to upload the ImageBrowser adds a new item and displays the "upload in progress" circle. First it shows the image's file name near the circle, then it changes to undefined.
But if I close the ImageBrowser then open it again, the thumbnail is there as expected, without an error. If I artificially produce an error in the controller, at the end of the create action, then an error popup appears in the Kendo ImageBrowser (with 404 or 500), and if I wait a bit before clicking on the ok button then after clicking on it the thumbnail is there as expected also.
So I guess 2 things:
I am not providing the correct/expected response for the ImageBrowser at the end of the create action. (tried to render the same json as I render for transport.read but the problem still occurs). In this case my question is: What kind of response does Kendo ImageBrowser expect?
It takes time to upload/process/resize the image and kendo asks too soon (so it gets an "undefined" result), and won't "ask" again.
In this case my question is: How/when to delay or call read again to display the newly uploaded image's thumbnail correctly, without getting undefined back?
Any suggestions to fix this? Or is it an error on Kendo UI side?
Heres snippet from the output:
Started POST "/kezelo/assets" for 127.0.0.1 at 2014-01-17 18:09:33 +0100
Processing by Kezelo::AssetsController#create as */*
Parameters: {"file"=>#<ActionDispatch::Http::UploadedFile:0x007fa78bb00b00 #tempfile=#<Tempfile:/var/folders/90/wjyhxjfs3gz3xkhsk8z_sz2w0000gn/T/RackMultipart20140117-49102-5lwwh4>, #original_filename="100_3048.JPG", #content_type="image/jpeg", #headers="Content-Disposition: form-data; name=\"file\"; filename=\"100_3048.JPG\"\r\nContent-Type: image/jpeg\r\n">, "path"=>"", "authenticity_token"=>"sdKhe348x26hm0k8kirzHlYgmH1LN73wf3ZWyOA5PHY="}
(0.1ms) begin transaction
SQL (0.7ms) INSERT INTO "assets" ("created_at", "image_file_size", "kendo_type", "photo", "updated_at") VALUES (?, ?, ?, ?, ?) [["created_at", Fri, 17 Jan 2014 17:09:35 UTC +00:00], ["image_file_size", 247716], ["kendo_type", "f"], ["photo", "100_3048.JPG"], ["updated_at", Fri, 17 Jan 2014 17:09:35 UTC +00:00]]
(1.6ms) commit transaction
Asset Load (0.4ms) SELECT "assets".* FROM "assets"
Completed 200 OK in 1416ms (Views: 29.7ms | ActiveRecord: 2.7ms)
Started GET "/uploads/assets/undefined" for 127.0.0.1 at 2014-01-17 18:09:35 +0100
ActionController::RoutingError (No route matches [GET] "/uploads/assets/undefined"):
actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call'
railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged'
activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged'
railties (4.0.2) lib/rails/rack/logger.rb:20:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call'
rack (1.5.2) lib/rack/methodoverride.rb:21:in `call'
rack (1.5.2) lib/rack/runtime.rb:17:in `call'
activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call'
rack (1.5.2) lib/rack/sendfile.rb:112:in `call'
railties (4.0.2) lib/rails/engine.rb:511:in `call'
railties (4.0.2) lib/rails/application.rb:97:in `call'
rack (1.5.2) lib/rack/lock.rb:17:in `call'
rack (1.5.2) lib/rack/content_length.rb:14:in `call'
rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run'
/usr/local/rvm/rubies/ruby-2.0.0-p247/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
Rendered /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.2/lib/action_dispatch/middleware/templates/rescues/_trace.erb (1.4ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.2/lib/action_dispatch/middleware/templates/routes/_route.html.erb (4.4ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.2/lib/action_dispatch/middleware/templates/routes/_table.html.erb (1.4ms)
Rendered /usr/local/rvm/gems/ruby-2.0.0-p247/gems/actionpack-4.0.2/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (47.9ms)
My transport read url is (with dataType: json):
http://localhost:3000/kezelo/assets
The json output for the above url:
[{"id":21,"name":"MAP_0528.JPG","type":"f","size":573896},{"id":22,"name":"MAP_0565.JPG","type":"f","size":646608},{"id":24,"name":"MAP_0667.JPG","type":"f","size":370408},{"id":26,"name":"mami_a_kertben.JPG","type":"f","size":364433},{"id":28,"name":"15kg_os.jpg","type":"f","size":975517},{"id":29,"name":"MAP_0257.jpg","type":"f","size":357723},{"id":31,"name":"DSC_0113.JPG","type":"f","size":574744},{"id":33,"name":"DSC_0062.JPG","type":"f","size":287631},{"id":34,"name":"100_2997.JPG","type":"f","size":126418},{"id":35,"name":"100_2999.JPG","type":"f","size":364433},{"id":36,"name":"100_3002.JPG","type":"f","size":340892},{"id":37,"name":"100_3025.JPG","type":"f","size":199709},{"id":38,"name":"100_3005.JPG","type":"f","size":435145},{"id":39,"name":"100_3019.JPG","type":"f","size":152869},{"id":40,"name":"100_3033.JPG","type":"f","size":208811},{"id":41,"name":"100_3039.JPG","type":"f","size":264420},{"id":42,"name":"100_3048.JPG","type":"f","size":247716}]
Problem solved. My first guess was right. I didn't provide the appropriate response for Kendo ImageBrowser.
It needed ONLY the uploaded image data in json format like this:
{"name":"new_image_name","type":"f","size":646608}
Now it works like a charm!
The most tricky thing of this integration was to provide a suitable json output for Kendo. For those who would like to use this editor in their apps, look into the acts_as_api gem. It will ease your pain.
Related
Rails 'parse_query' error on server in brand new app
I have installed on OS X 10.10.3: homebrew, command line tools, then installed ruby using rbenv: ruby 2.2.2p95 (2015-04-13 revision 50295) [x86_64-darwin14] Rails 4.2.2 when I create a new app (with default sqlite database) and try to run it, it says: => Booting WEBrick => Rails 4.2.2 application starting in development on http://localhost:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server [2015-06-18 23:11:30] INFO WEBrick 1.3.1 [2015-06-18 23:11:30] INFO ruby 2.2.2 (2015-04-13) [x86_64-darwin14] [2015-06-18 23:11:30] INFO WEBrick::HTTPServer#start: pid=41860 port=3000 but in the browser I see: 500 Internal Server Error If you are the administrator of this website, then please read this web application's log file and/or the web server's log file to find out what went wrong. log file: Started GET "/" for ::1 at 2015-06-18 23:11:48 +0300 **ArgumentError (wrong number of arguments (2 for 1)):** actionpack (4.2.2) lib/action_dispatch/http/request.rb:338:in `parse_query' rack (1.6.3) lib/rack/request.rb:191:in `GET' actionpack (4.2.2) lib/action_dispatch/http/request.rb:300:in `GET' actionpack (4.2.2) lib/action_dispatch/http/parameters.rb:14:in `parameters' actionpack (4.2.2) lib/action_dispatch/http/filter_parameters.rb:37:in `filtered_parameters' actionpack (4.2.2) lib/action_controller/metal/instrumentation.rb:22:in `process_action' actionpack (4.2.2) lib/action_controller/metal/params_wrapper.rb:250:in `process_action' activerecord (4.2.2) lib/active_record/railties/controller_runtime.rb:18:in `process_action' actionpack (4.2.2) lib/abstract_controller/base.rb:137:in `process' actionview (4.2.2) lib/action_view/rendering.rb:30:in `process' actionpack (4.2.2) lib/action_controller/metal.rb:196:in `dispatch' actionpack (4.2.2) lib/action_controller/metal/rack_delegation.rb:13:in `dispatch' actionpack (4.2.2) lib/action_controller/metal.rb:237:in `block in action' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `call' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:74:in `dispatch' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:43:in `serve' actionpack (4.2.2) lib/action_dispatch/journey/router.rb:43:in `block in serve' actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `each' actionpack (4.2.2) lib/action_dispatch/journey/router.rb:30:in `serve' actionpack (4.2.2) lib/action_dispatch/routing/route_set.rb:819:in `call' rack (1.6.3) lib/rack/etag.rb:24:in `call' rack (1.6.3) lib/rack/conditionalget.rb:25:in `call' rack (1.6.3) lib/rack/head.rb:13:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/params_parser.rb:27:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/flash.rb:260:in `call' rack (1.6.3) lib/rack/session/abstract/id.rb:225:in `context' rack (1.6.3) lib/rack/session/abstract/id.rb:220:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/cookies.rb:560:in `call' activerecord (4.2.2) lib/active_record/query_cache.rb:36:in `call' activerecord (4.2.2) lib/active_record/connection_adapters/abstract/connection_pool.rb:649:in `call' activerecord (4.2.2) lib/active_record/migration.rb:378:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:29:in `block in call' activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `call' activesupport (4.2.2) lib/active_support/callbacks.rb:88:in `_run_callbacks' activesupport (4.2.2) lib/active_support/callbacks.rb:776:in `_run_call_callbacks' activesupport (4.2.2) lib/active_support/callbacks.rb:81:in `run_callbacks' actionpack (4.2.2) lib/action_dispatch/middleware/callbacks.rb:27:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/reloader.rb:73:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/remote_ip.rb:78:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/debug_exceptions.rb:17:in `call' web-console (2.1.3) lib/web_console/middleware.rb:37:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.2.2) lib/rails/rack/logger.rb:38:in `call_app' railties (4.2.2) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `block in tagged' activesupport (4.2.2) lib/active_support/tagged_logging.rb:26:in `tagged' activesupport (4.2.2) lib/active_support/tagged_logging.rb:68:in `tagged' railties (4.2.2) lib/rails/rack/logger.rb:20:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.6.3) lib/rack/methodoverride.rb:22:in `call' rack (1.6.3) lib/rack/runtime.rb:18:in `call' activesupport (4.2.2) lib/active_support/cache/strategy/local_cache_middleware.rb:28:in `call' rack (1.6.3) lib/rack/lock.rb:17:in `call' actionpack (4.2.2) lib/action_dispatch/middleware/static.rb:113:in `call' rack (1.6.3) lib/rack/sendfile.rb:113:in `call' railties (4.2.2) lib/rails/engine.rb:518:in `call' railties (4.2.2) lib/rails/application.rb:164:in `call' rack (1.6.3) lib/rack/lock.rb:17:in `call' rack (1.6.3) lib/rack/content_length.rb:15:in `call' rack (1.6.3) lib/rack/handler/webrick.rb:88:in `service' /Users/smi/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:138:in `service' /Users/smi/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/httpserver.rb:94:in `run' /Users/smi/.rbenv/versions/2.2.2/lib/ruby/2.2.0/webrick/server.rb:294:in `block in start_thread' Rendered /Users/smi/.rbenv/versions/2.2.2/lib/ruby/gems/2.2.0/gems/actionpack-4.2.2/lib/action_dispatch/middleware/templates/rescues/diagnostics.html.erb within rescues/layout (22.3ms) Somebody has a similar error? how did you resolve this?
The issue is here: https://github.com/rails/rails/issues/20624 To solve it, change in your Gemfile: gem 'rack', '1.6.1'
I was getting the same thing, but with Rails 4.2.1, and running on Puma 2.11.3. I noticed that Bundler just upgraded rack to 1.6.3. Setting the version back to 1.6.2 resolved it for me.
What is this error from?
I have absolutely no idea what I changed. The unicorn configuration has been static for months. And suddenly I start seeing this error - it seems related to something about workers but this is on dev and I have that part disabled in my app for dev. I'm totally stumped as to what happened - some update to unicorn? EDIT: I should have been more clear. I KNOW it's a route problem. The trouble is, I do not know what is calling /inform. I am not calling this anywhere in my written code. Which means some gem is expecting there to be a resource at /inform, and it appears to be related to Unicorn. But I haven't changed anything to do with Unicorn in over 6 months. Which leads me to believe that some time I ran bundle install brought up a new version of the gem. Try as I might, I haven't been able to identify what changed and where. Started POST "/inform" for 192.168.1.9 at 2014-08-08 16:46:01 -0500 ActionController::RoutingError (No route matches [POST] "/inform"): actionpack (3.2.13) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' railties (3.2.13) lib/rails/rack/logger.rb:32:in `call_app' railties (3.2.13) lib/rails/rack/logger.rb:16:in `block in call' activesupport (3.2.13) lib/active_support/tagged_logging.rb:22:in `tagged' railties (3.2.13) lib/rails/rack/logger.rb:16:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/request_id.rb:22:in `call' rack (1.4.5) lib/rack/methodoverride.rb:21:in `call' rack (1.4.5) lib/rack/runtime.rb:17:in `call' activesupport (3.2.13) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.4.5) lib/rack/lock.rb:15:in `call' actionpack (3.2.13) lib/action_dispatch/middleware/static.rb:63:in `call' railties (3.2.13) lib/rails/engine.rb:479:in `call' railties (3.2.13) lib/rails/application.rb:223:in `call' railties (3.2.13) lib/rails/railtie/configurable.rb:30:in `method_missing' rack (1.4.5) lib/rack/lint.rb:48:in `_call' rack (1.4.5) lib/rack/lint.rb:36:in `call' rack (1.4.5) lib/rack/showexceptions.rb:24:in `call' rack (1.4.5) lib/rack/commonlogger.rb:33:in `call' rack (1.4.5) lib/rack/chunked.rb:43:in `call' rack (1.4.5) lib/rack/content_length.rb:14:in `call' unicorn (4.8.0) lib/unicorn/http_server.rb:571:in `process_client' unicorn (4.8.0) lib/unicorn/http_server.rb:658:in `worker_loop' unicorn (4.8.0) lib/unicorn/http_server.rb:520:in `spawn_missing_workers' unicorn (4.8.0) lib/unicorn/http_server.rb:140:in `start' unicorn (4.8.0) bin/unicorn:126:in `<top (required)>' /usr/local/rvm/gems/ruby-2.0.0-p451/bin/unicorn:23:in `load' /usr/local/rvm/gems/ruby-2.0.0-p451/bin/unicorn:23:in `<main>' /usr/local/rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `eval' /usr/local/rvm/gems/ruby-2.0.0-p451/bin/ruby_executable_hooks:15:in `<main>' I added a fake route to stuff whatever came across into a collection: Started POST "/inform" for 192.168.1.9 at 2014-08-14 20:48:45 -0500 Processing by ApiController#inform as HTML WARNING: Can't verify CSRF token authenticity MONGODB (0.5ms) creative_development['admins'].find({:_id=>nil}).limit(-1) Redirected to http://192.168.x.x/login Filter chain halted as :require_login rendered or redirected Completed 302 Found in 1ms 192.168.1.9 - - [14/Aug/2014 20:48:45] "POST /inform HTTP/1.1" 302 - 0.0150 Of course it halted because whatever this is isn't part of my application and hasn't authenticated. Still no idea what's causing it.
How do I set up a rails production server using ruby on rails?
I started learning about ruby on rails and heroku and I have come to the problem of not being able to see the newly created app in heroku. I tried running the server locally by using the command: rails server The app showed on the browser successfully but when I type the command rails server -e production The browser displays an error saying "The page you were looking for doesn't exist...". This is the same error I get when I try accessing the app through heroku. I'm very new to heroku and ruby on rails so I'm not sure where to go from here. The console shows this when I try the -e production option ActionController::RoutingError (No route matches [GET] "/"): actionpack (4.0.2) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (4.0.2) lib/action_dispatch/middleware/show_exceptions.rb:30:in `call' railties (4.0.2) lib/rails/rack/logger.rb:38:in `call_app' railties (4.0.2) lib/rails/rack/logger.rb:20:in `block in call' activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `block in tagged' activesupport (4.0.2) lib/active_support/tagged_logging.rb:25:in `tagged' activesupport (4.0.2) lib/active_support/tagged_logging.rb:67:in `tagged' railties (4.0.2) lib/rails/rack/logger.rb:20:in `call' actionpack (4.0.2) lib/action_dispatch/middleware/request_id.rb:21:in `call' rack (1.5.2) lib/rack/methodoverride.rb:21:in `call' rack (1.5.2) lib/rack/runtime.rb:17:in `call' activesupport (4.0.2) lib/active_support/cache/strategy/local_cache.rb:83:in `call' actionpack (4.0.2) lib/action_dispatch/middleware/static.rb:64:in `call' rack (1.5.2) lib/rack/sendfile.rb:112:in `call' railties (4.0.2) lib/rails/engine.rb:511:in `call' railties (4.0.2) lib/rails/application.rb:97:in `call' rack (1.5.2) lib/rack/lock.rb:17:in `call' rack (1.5.2) lib/rack/content_length.rb:14:in `call' rack (1.5.2) lib/rack/handler/webrick.rb:60:in `service' /home/adcalder7/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:138:in `service' /home/adcalder7/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/httpserver.rb:94:in `run' /home/adcalder7/.rvm/rubies/ruby-2.0.0-p353/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
The solution to this problem is to add an index to your root. Like this example shows: Link
Unusal loading error
I am getting an unusual error which i dont know how to solve. Can any body please help. My project takes a lot of time in loading. Rendered /Users/Ahmad/.rvm/gems/ruby-1.9.2-p320#b_finder/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.9ms[2012-10-29 22:29:43] ERROR Errno::ECONNRESET: Connection reset by peer /Users/Ahmad/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `eof?' /Users/Ahmad/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:56:in `run' /Users/Ahmad/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' Started GET "/assets/home.css?body=1" for 127.0.0.1 at 2012-10-29 22:29:43 +0530 Served asset /home.css - 304 Not Modified (3ms) Started GET "/assets/list.css?body=1" for 127.0.0.1 at 2012-10-29 22:29:43 +0530 Served asset /list.css - 304 Not Modified (2ms) Started GET "/assets/user.css?body=1" for 127.0.0.1 at 2012-10-29 22:29:43 +0530 Served asset /user.css - 304 Not Modified (2ms) Started GET "/js/less.js" for 127.0.0.1 at 2012-10-29 22:29:43 +0530 ActionController::RoutingError (No route matches [GET] "/js/less.js"): actionpack (3.2.8) lib/action_dispatch/middleware/debug_exceptions.rb:21:in `call' actionpack (3.2.8) lib/action_dispatch/middleware/show_exceptions.rb:56:in `call' railties (3.2.8) lib/rails/rack/logger.rb:26:in `call_app' railties (3.2.8) lib/rails/rack/logger.rb:16:in `call' actionpack (3.2.8) lib/action_dispatch/middleware/request_id.rb:22:in `call' rack (1.4.1) lib/rack/methodoverride.rb:21:in `call' rack (1.4.1) lib/rack/runtime.rb:17:in `call' activesupport (3.2.8) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.4.1) lib/rack/lock.rb:15:in `call' actionpack (3.2.8) lib/action_dispatch/middleware/static.rb:62:in `call' railties (3.2.8) lib/rails/engine.rb:479:in `call' railties (3.2.8) lib/rails/application.rb:223:in `call' rack (1.4.1) lib/rack/content_length.rb:14:in `call' railties (3.2.8) lib/rails/rack/log_tailer.rb:17:in `call' rack (1.4.1) lib/rack/handler/webrick.rb:59:in `service' /Users/Ahmad/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' /Users/Ahmad/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' /Users/Ahmad/.rvm/rubies/ruby-1.9.2-p320/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' Rendered /Users/Ahmad/.rvm/gems/ruby-1.9.2-p320#b_finder/gems/actionpack-3.2.8/lib/action_dispatch/middleware/templates/rescues/routing_error.erb within rescues/layout (0.8ms) I dont understand why it is giving such errors. One more thing ive noticed. I ve used twitter bootstrap Tabbable nav for that js is required. But if i m not connected to internet then that tab is not work. Although i ve manually pasted the js and all files of bootstrap in assets pipeline.
Sounds like a loading error, in your case it can't find the less.js file. Have you placed it in the correct position? app -> assets -> javascript
undefined method `children' for nil:NilClass
Okay. I'm past my wit here. I've got a rails app that I haven't worked on in about 3 weeks...yet when I left off it did not produce this error anywhere. I am using the latest versions of many gems yet all of them seem to be working. I'm working under ruby1.9 now and so I upgraded things to match that. I am reasonably sure that is the only significant thing to change since 3 weeks ago. Many pages render just fine, but one page fails with a NoMethodError "undefined method `children' for nil:NilClass" and the following seemingly framework-only stack trace. For the page in question I have gone so far as to comment out the entire haml page, the controller method, all before_filters, all of application_controller, and a few other things. I've downgraded haml and compass suspecting that they were the culprits even though other pages render just fine. I'm currently back to the stable branches on everything except, I think devise, but that doesn't seem to be part of the issue because logins work just fine. activesupport (3.0.7) lib/active_support/whiny_nil.rb:48:in `method_missing' haml (3.1.1) lib/haml/parser.rb:151:in `parse' haml (3.1.1) lib/haml/engine.rb:124:in `initialize' haml (3.1.1) lib/haml/template/plugin.rb:34:in `new' haml (3.1.1) lib/haml/template/plugin.rb:34:in `compile' haml (3.1.1) lib/haml/template/plugin.rb:39:in `call' actionpack (3.0.7) lib/action_view/template.rb:226:in `compile' actionpack (3.0.7) lib/action_view/template.rb:134:in `block in render' activesupport (3.0.7) lib/active_support/notifications.rb:54:in `instrument' actionpack (3.0.7) lib/action_view/template.rb:127:in `render' actionpack (3.0.7) lib/action_view/render/rendering.rb:59:in `block in _render_template' activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument' activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument' activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument' actionpack (3.0.7) lib/action_view/render/rendering.rb:56:in `_render_template' actionpack (3.0.7) lib/action_view/render/rendering.rb:26:in `render' haml (3.1.1) lib/haml/helpers/action_view_mods.rb:13:in `render_with_haml' actionpack (3.0.7) lib/abstract_controller/rendering.rb:115:in `_render_template' actionpack (3.0.7) lib/abstract_controller/rendering.rb:109:in `render_to_body' actionpack (3.0.7) lib/action_controller/metal/renderers.rb:47:in `render_to_body' actionpack (3.0.7) lib/action_controller/metal/compatibility.rb:55:in `render_to_body' actionpack (3.0.7) lib/abstract_controller/rendering.rb:102:in `render_to_string' actionpack (3.0.7) lib/abstract_controller/rendering.rb:93:in `render' actionpack (3.0.7) lib/action_controller/metal/rendering.rb:17:in `render' actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:40:in `block (2 levels) in render' activesupport (3.0.7) lib/active_support/core_ext/benchmark.rb:5:in `block in ms' /Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/benchmark.rb:309:in `realtime' activesupport (3.0.7) lib/active_support/core_ext/benchmark.rb:5:in `ms' actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:40:in `block in render' actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:78:in `cleanup_view_runtime' activerecord (3.0.7) lib/active_record/railties/controller_runtime.rb:15:in `cleanup_view_runtime' actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:39:in `render' actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:14:in `default_render' actionpack (3.0.7) lib/action_controller/metal/implicit_render.rb:6:in `send_action' actionpack (3.0.7) lib/abstract_controller/base.rb:150:in `process_action' actionpack (3.0.7) lib/action_controller/metal/rendering.rb:11:in `process_action' actionpack (3.0.7) lib/abstract_controller/callbacks.rb:18:in `block in process_action' activesupport (3.0.7) lib/active_support/callbacks.rb:436:in `_run__1376965243214072245__process_action__2201785587746499238__callbacks' activesupport (3.0.7) lib/active_support/callbacks.rb:410:in `_run_process_action_callbacks' activesupport (3.0.7) lib/active_support/callbacks.rb:94:in `run_callbacks' actionpack (3.0.7) lib/abstract_controller/callbacks.rb:17:in `process_action' actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:30:in `block in process_action' activesupport (3.0.7) lib/active_support/notifications.rb:52:in `block in instrument' activesupport (3.0.7) lib/active_support/notifications/instrumenter.rb:21:in `instrument' activesupport (3.0.7) lib/active_support/notifications.rb:52:in `instrument' actionpack (3.0.7) lib/action_controller/metal/instrumentation.rb:29:in `process_action' actionpack (3.0.7) lib/action_controller/metal/rescue.rb:17:in `process_action' actionpack (3.0.7) lib/abstract_controller/base.rb:119:in `process' actionpack (3.0.7) lib/abstract_controller/rendering.rb:41:in `process' actionpack (3.0.7) lib/action_controller/metal.rb:138:in `dispatch' actionpack (3.0.7) lib/action_controller/metal/rack_delegation.rb:14:in `dispatch' actionpack (3.0.7) lib/action_controller/metal.rb:178:in `block in action' actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `call' actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:62:in `dispatch' actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:27:in `call' rack-mount (0.6.14) lib/rack/mount/route_set.rb:148:in `block in call' rack-mount (0.6.14) lib/rack/mount/code_generation.rb:93:in `block in recognize' rack-mount (0.6.14) lib/rack/mount/code_generation.rb:68:in `optimized_each' rack-mount (0.6.14) lib/rack/mount/code_generation.rb:92:in `recognize' rack-mount (0.6.14) lib/rack/mount/route_set.rb:139:in `call' actionpack (3.0.7) lib/action_dispatch/routing/route_set.rb:493:in `call' sass (3.1.1) lib/sass/plugin/rack.rb:54:in `call' warden (1.0.4) lib/warden/manager.rb:35:in `block in call' warden (1.0.4) lib/warden/manager.rb:34:in `catch' warden (1.0.4) lib/warden/manager.rb:34:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/best_standards_support.rb:17:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/head.rb:14:in `call' rack (1.2.2) lib/rack/methodoverride.rb:24:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/params_parser.rb:21:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/flash.rb:182:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/session/abstract_store.rb:149:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/cookies.rb:302:in `call' activerecord (3.0.7) lib/active_record/query_cache.rb:32:in `block in call' activerecord (3.0.7) lib/active_record/connection_adapters/abstract/query_cache.rb:28:in `cache' activerecord (3.0.7) lib/active_record/query_cache.rb:12:in `cache' activerecord (3.0.7) lib/active_record/query_cache.rb:31:in `call' activerecord (3.0.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:354:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:46:in `block in call' activesupport (3.0.7) lib/active_support/callbacks.rb:416:in `_run_call_callbacks' actionpack (3.0.7) lib/action_dispatch/middleware/callbacks.rb:44:in `call' rack (1.2.2) lib/rack/sendfile.rb:107:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/remote_ip.rb:48:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/show_exceptions.rb:47:in `call' railties (3.0.7) lib/rails/rack/logger.rb:13:in `call' rack (1.2.2) lib/rack/runtime.rb:17:in `call' activesupport (3.0.7) lib/active_support/cache/strategy/local_cache.rb:72:in `call' rack (1.2.2) lib/rack/lock.rb:11:in `block in call' <internal:prelude>:10:in `synchronize' rack (1.2.2) lib/rack/lock.rb:11:in `call' actionpack (3.0.7) lib/action_dispatch/middleware/static.rb:30:in `call' railties (3.0.7) lib/rails/application.rb:168:in `call' railties (3.0.7) lib/rails/application.rb:77:in `method_missing' railties (3.0.7) lib/rails/rack/log_tailer.rb:14:in `call' rack (1.2.2) lib/rack/content_length.rb:13:in `call' rack (1.2.2) lib/rack/handler/webrick.rb:52:in `service' /Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:111:in `service' /Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/httpserver.rb:70:in `run' /Users/DeVeLoPeR/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/webrick/server.rb:183:in `block in start_thread' I am starting to think that the change to ruby 1.9.2 has caused this but I can't think how it would. I'm going to pull back to ruby 1.8.7 so I can get working again (hopefully) but our production server runs 1.9.2 so I'll need it at some point. Any thoughts are appreciated. Thanks Edit Downgrading to Ruby1.8.7 Had no effect. I also tried it on another computer without RVM. Edit Gemfile as requested: source 'http://rubygems.org' gem 'rails', '3.0.7' gem 'sqlite3-ruby', :require => 'sqlite3' gem 'mysql' gem "will_paginate", "~> 3.0.pre2" gem 'activemerchant' gem 'devise', '1.1.9' gem 'ruby-debug' gem 'sslrequirement' gem 'cancan' gem 'rmagick' gem 'carrierwave', "~> 0.5.3" gem 'haml' gem 'compass' #gem 'mongrel' gem 'jquery-rails' group :development, :test do gem 'webrat' gem 'wirble' end
Do you use HAML comments (-#)? Removing them worked for me.