Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined method `full_comment' for nil:NilClass #13

Open
ptopinka opened this issue Aug 20, 2013 · 6 comments
Open

undefined method `full_comment' for nil:NilClass #13

ptopinka opened this issue Aug 20, 2013 · 6 comments

Comments

@ptopinka
Copy link

Hi, we are using rake_hooks and we have problem in the following method.
Have you faced this problem before?

NoMethodError (undefined method full_comment' for nil:NilClass): rake-hooks (1.2.3) lib/rake/hooks.rb:16:inblock in after'
rake-hooks (1.2.3) lib/rake/hooks.rb:14:in each' rake-hooks (1.2.3) lib/rake/hooks.rb:14:inafter'
a

@ptopinka
Copy link
Author

full stack

NoMethodError (undefined method full_comment' for nil:NilClass): rake-hooks (1.2.3) lib/rake/hooks.rb:16:inblock in after'
rake-hooks (1.2.3) lib/rake/hooks.rb:14:in each' rake-hooks (1.2.3) lib/rake/hooks.rb:14:inafter'
activesupport (3.2.7) lib/active_support/callbacks.rb:310:in _callback_after_277' activesupport (3.2.7) lib/active_support/callbacks.rb:493:in_run__686252016__process_action__298567229__callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.7) lib/active_support/callbacks.rb:385:in_run_process_action_callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (3.2.7) lib/abstract_controller/callbacks.rb:17:inprocess_action'
actionpack (3.2.7) lib/action_controller/metal/rescue.rb:29:in process_action' actionpack (3.2.7) lib/action_controller/metal/instrumentation.rb:30:inblock in process_action'
activesupport (3.2.7) lib/active_support/notifications.rb:123:in block in instrument' activesupport (3.2.7) lib/active_support/notifications/instrumenter.rb:20:ininstrument'
activesupport (3.2.7) lib/active_support/notifications.rb:123:in instrument' actionpack (3.2.7) lib/action_controller/metal/instrumentation.rb:29:inprocess_action'
actionpack (3.2.7) lib/action_controller/metal/params_wrapper.rb:207:in process_action' activerecord (3.2.7) lib/active_record/railties/controller_runtime.rb:18:inprocess_action'
actionpack (3.2.7) lib/abstract_controller/base.rb:121:in process' actionpack (3.2.7) lib/abstract_controller/rendering.rb:45:inprocess'
actionpack (3.2.7) lib/action_controller/metal.rb:203:in dispatch' actionpack (3.2.7) lib/action_controller/metal/rack_delegation.rb:14:indispatch'
actionpack (3.2.7) lib/action_controller/metal.rb:246:in block in action' actionpack (3.2.7) lib/action_dispatch/routing/route_set.rb:73:incall'
actionpack (3.2.7) lib/action_dispatch/routing/route_set.rb:73:in dispatch' actionpack (3.2.7) lib/action_dispatch/routing/route_set.rb:36:incall'
journey (1.0.4) lib/journey/router.rb:68:in block in call' journey (1.0.4) lib/journey/router.rb:56:ineach'
journey (1.0.4) lib/journey/router.rb:56:in call' actionpack (3.2.7) lib/action_dispatch/routing/route_set.rb:600:incall'
warden (1.2.1) lib/warden/manager.rb:35:in block in call' warden (1.2.1) lib/warden/manager.rb:34:incatch'
warden (1.2.1) lib/warden/manager.rb:34:in call' actionpack (3.2.7) lib/action_dispatch/middleware/best_standards_support.rb:17:incall'
rack (1.4.1) lib/rack/etag.rb:23:in call' rack (1.4.1) lib/rack/conditionalget.rb:35:incall'
actionpack (3.2.7) lib/action_dispatch/middleware/head.rb:14:in call' actionpack (3.2.7) lib/action_dispatch/middleware/params_parser.rb:21:incall'
actionpack (3.2.7) lib/action_dispatch/middleware/flash.rb:242:in call' rack (1.4.1) lib/rack/session/abstract/id.rb:205:incontext'
rack (1.4.1) lib/rack/session/abstract/id.rb:200:in call' actionpack (3.2.7) lib/action_dispatch/middleware/cookies.rb:338:incall'
activerecord (3.2.7) lib/active_record/query_cache.rb:64:in call' activerecord (3.2.7) lib/active_record/connection_adapters/abstract/connection_pool.rb:473:incall'
actionpack (3.2.7) lib/action_dispatch/middleware/callbacks.rb:28:in block in call' activesupport (3.2.7) lib/active_support/callbacks.rb:405:in_run__200987313__call__975164160__callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:405:in __run_callback' activesupport (3.2.7) lib/active_support/callbacks.rb:385:in_run_call_callbacks'
activesupport (3.2.7) lib/active_support/callbacks.rb:81:in run_callbacks' actionpack (3.2.7) lib/action_dispatch/middleware/callbacks.rb:27:incall'
rack (1.4.1) lib/rack/sendfile.rb:102:in call' actionpack (3.2.7) lib/action_dispatch/middleware/remote_ip.rb:31:incall'
actionpack (3.2.7) lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' actionpack (3.2.7) lib/action_dispatch/middleware/show_exceptions.rb:56:incall'
railties (3.2.7) lib/rails/rack/logger.rb:26:in call_app' railties (3.2.7) lib/rails/rack/logger.rb:16:incall'
actionpack (3.2.7) lib/action_dispatch/middleware/request_id.rb:22:in call' rack (1.4.1) lib/rack/methodoverride.rb:21:incall'
rack (1.4.1) lib/rack/runtime.rb:17:in call' activesupport (3.2.7) lib/active_support/cache/strategy/local_cache.rb:72:incall'
rack (1.4.1) lib/rack/lock.rb:15:in call' actionpack (3.2.7) lib/action_dispatch/middleware/static.rb:62:incall'
rack-cache (1.2) lib/rack/cache/context.rb:136:in forward' rack-cache (1.2) lib/rack/cache/context.rb:143:inpass'
rack-cache (1.2) lib/rack/cache/context.rb:155:in invalidate' rack-cache (1.2) lib/rack/cache/context.rb:71:incall!'
rack-cache (1.2) lib/rack/cache/context.rb:51:in call' railties (3.2.7) lib/rails/engine.rb:479:incall'
railties (3.2.7) lib/rails/application.rb:220:in call' railties (3.2.7) lib/rails/railtie/configurable.rb:30:inmethod_missing'
passenger (3.0.18) lib/phusion_passenger/rack/request_handler.rb:96:in process_request' passenger (3.0.18) lib/phusion_passenger/abstract_request_handler.rb:516:inaccept_and_process_next_request'
passenger (3.0.18) lib/phusion_passenger/abstract_request_handler.rb:274:in main_loop' passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:206:instart_request_handler'
passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:171:in block in handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/utils.rb:470:insafe_fork'
passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:166:in handle_spawn_application' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:357:inserver_main_loop'
passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:206:in start_synchronously' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:180:instart'
passenger (3.0.18) lib/phusion_passenger/rack/application_spawner.rb:129:in start' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:253:inblock (2 levels) in spawn_rack_application'
passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:132:in lookup_or_add' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:246:inblock in spawn_rack_application'
passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:82:in block in synchronize' <internal:prelude>:10:insynchronize'
passenger (3.0.18) lib/phusion_passenger/abstract_server_collection.rb:79:in synchronize' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:244:inspawn_rack_application'
passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:137:in spawn_application' passenger (3.0.18) lib/phusion_passenger/spawn_manager.rb:275:inhandle_spawn_application'
passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:357:in server_main_loop' passenger (3.0.18) lib/phusion_passenger/abstract_server.rb:206:instart_synchronously'
passenger (3.0.18) helper-scripts/passenger-spawn-server:99:in `

'

@bartlomiejdanek
Copy link

bump

@bradgreens
Copy link

+1 same problem

My problem was resolved using the namespace technique shown in #12.

@abuisman
Copy link

abuisman commented Aug 6, 2015

I get this error when I run my specs only, not when I run rails c in my console and it was caused by 'def after' in here: https://github.com/guillermo/rake-hooks/blob/e45a26e24f1e525dd8398423b95029bcb024428d/lib/rake/hooks.rb

My code is something like:

perform_some_method if something && a-thing.after(Time.now)

In this case a-thing is an empty array, I am not sure if this matters.

It seems like the after method of rake-hooks is called, while I was expecting some other code to be called and it seems like rake-hooks is included globally because I have require 'rake-hooks' in my lib/tasks/some-task.rb`

So this is not a namespace issue.

@davidsilvasmith
Copy link

Seems like this is still open?

I'm having a conflict with delayed_jobs and the deliver_later mailer.

@philihp
Copy link

philihp commented Apr 18, 2018

I came across this error when I was doing something like

task :foo do
  puts 'foo'
end
task :bar do
  puts 'bar'
end
after [:foo, :bar] do
  puts 'after'
end

My solution was to do this:

after :foo, :bar do
  puts 'after'
end

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants