Undefined method `eq' for nil:NilClass

Hi,
Please help in this regard
I got the error when tried to apply the script for sql command “SELECT *
FROM clients WHERE (clients.id = 10)”

Taxa = Model Name

I used
“taxa = Taxa.find(40)” in ActiveRecord::Base… I got the trace as

undefined method `eq’ for nil:NilClass

activesupport (3.0.0) lib/active_support/whiny_nil.rb:48:in
`method_missing’

activerecord (3.0.0)
lib/active_record/relation/finder_methods.rb:291:in find_one' activerecord (3.0.0) lib/active_record/relation/finder_methods.rb:281:infind_with_ids’
activerecord (3.0.0) lib/active_record/relation/finder_methods.rb:107:in
find' activerecord (3.0.0) lib/active_record/base.rb:439:infind’
app/models/taxa.rb:2:in <class:Taxa>' app/models/taxa.rb:1:in<top (required)>’
activesupport (3.0.0) lib/active_support/dependencies.rb:454:in load' activesupport (3.0.0) lib/active_support/dependencies.rb:454:inblock
in load_file’
activesupport (3.0.0) lib/active_support/dependencies.rb:591:in
new_constants_in' activesupport (3.0.0) lib/active_support/dependencies.rb:453:inload_file’
activesupport (3.0.0) lib/active_support/dependencies.rb:340:in
require_or_load' activesupport (3.0.0) lib/active_support/dependencies.rb:491:inload_missing_constant’
activesupport (3.0.0) lib/active_support/dependencies.rb:183:in block in const_missing' activesupport (3.0.0) lib/active_support/dependencies.rb:181:ineach’
activesupport (3.0.0) lib/active_support/dependencies.rb:181:in
const_missing' activesupport (3.0.0) lib/active_support/dependencies.rb:503:inload_missing_constant’
activesupport (3.0.0) lib/active_support/dependencies.rb:183:in block in const_missing' activesupport (3.0.0) lib/active_support/dependencies.rb:181:ineach’
activesupport (3.0.0) lib/active_support/dependencies.rb:181:in
const_missing' app/controllers/taxas_controller.rb:5:inindex’
actionpack (3.0.0) lib/action_controller/metal/implicit_render.rb:4:in
send_action' actionpack (3.0.0) lib/abstract_controller/base.rb:150:inprocess_action’
actionpack (3.0.0) lib/action_controller/metal/rendering.rb:11:in
process_action' actionpack (3.0.0) lib/abstract_controller/callbacks.rb:18:inblock
in process_action’
activesupport (3.0.0) lib/active_support/callbacks.rb:435:in
_run__2427101748358611573__process_action__3945483506732757257__callbacks' activesupport (3.0.0) lib/active_support/callbacks.rb:409:in_run_process_action_callbacks’
activesupport (3.0.0) lib/active_support/callbacks.rb:93:in
run_callbacks' actionpack (3.0.0) lib/abstract_controller/callbacks.rb:17:inprocess_action’
actionpack (3.0.0)
lib/action_controller/metal/instrumentation.rb:30:in block in process_action' activesupport (3.0.0) lib/active_support/notifications.rb:52:inblock
in instrument’
activesupport (3.0.0)
lib/active_support/notifications/instrumenter.rb:21:in instrument' activesupport (3.0.0) lib/active_support/notifications.rb:52:ininstrument’
actionpack (3.0.0)
lib/action_controller/metal/instrumentation.rb:29:in process_action' actionpack (3.0.0) lib/action_controller/metal/rescue.rb:17:inprocess_action’
actionpack (3.0.0) lib/abstract_controller/base.rb:119:in process' actionpack (3.0.0) lib/abstract_controller/rendering.rb:40:inprocess’
actionpack (3.0.0) lib/action_controller/metal.rb:133:in dispatch' actionpack (3.0.0) lib/action_controller/metal/rack_delegation.rb:14:indispatch’
actionpack (3.0.0) lib/action_controller/metal.rb:173:in block in action' actionpack (3.0.0) lib/action_dispatch/routing/route_set.rb:62:incall’
actionpack (3.0.0) lib/action_dispatch/routing/route_set.rb:62:in
dispatch' actionpack (3.0.0) lib/action_dispatch/routing/route_set.rb:27:incall’
rack-mount (0.6.13) lib/rack/mount/route_set.rb:148:in block in call' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:93:inblock in
recognize’
rack-mount (0.6.13) lib/rack/mount/code_generation.rb:68:in
optimized_each' rack-mount (0.6.13) lib/rack/mount/code_generation.rb:92:inrecognize’
rack-mount (0.6.13) lib/rack/mount/route_set.rb:139:in call' actionpack (3.0.0) lib/action_dispatch/routing/route_set.rb:492:incall’
actionpack (3.0.0)
lib/action_dispatch/middleware/best_standards_support.rb:17:in call' actionpack (3.0.0) lib/action_dispatch/middleware/head.rb:14:incall’
rack (1.2.1) lib/rack/methodoverride.rb:24:in call' actionpack (3.0.0) lib/action_dispatch/middleware/params_parser.rb:21:incall’
actionpack (3.0.0) lib/action_dispatch/middleware/flash.rb:182:in call' actionpack (3.0.0) lib/action_dispatch/middleware/session/abstract_store.rb:149:incall’
actionpack (3.0.0) lib/action_dispatch/middleware/cookies.rb:287:in
call' activerecord (3.0.0) lib/active_record/query_cache.rb:32:inblock in
call’
activerecord (3.0.0)
lib/active_record/connection_adapters/abstract/query_cache.rb:28:in
cache' activerecord (3.0.0) lib/active_record/query_cache.rb:12:incache’
activerecord (3.0.0) lib/active_record/query_cache.rb:31:in call' activerecord (3.0.0) lib/active_record/connection_adapters/abstract/connection_pool.rb:355:incall’
actionpack (3.0.0) lib/action_dispatch/middleware/callbacks.rb:46:in
block in call' activesupport (3.0.0) lib/active_support/callbacks.rb:415:in_run_call_callbacks’
actionpack (3.0.0) lib/action_dispatch/middleware/callbacks.rb:44:in
call' rack (1.2.1) lib/rack/sendfile.rb:107:incall’
actionpack (3.0.0) lib/action_dispatch/middleware/remote_ip.rb:48:in
call' actionpack (3.0.0) lib/action_dispatch/middleware/show_exceptions.rb:46:incall’
railties (3.0.0) lib/rails/rack/logger.rb:13:in call' rack (1.2.1) lib/rack/runtime.rb:17:incall’
activesupport (3.0.0)
lib/active_support/cache/strategy/local_cache.rb:72:in call' rack (1.2.1) lib/rack/lock.rb:11:inblock in call’
internal:prelude:10:in synchronize' rack (1.2.1) lib/rack/lock.rb:11:incall’
actionpack (3.0.0) lib/action_dispatch/middleware/static.rb:30:in call' railties (3.0.0) lib/rails/application.rb:168:incall’
railties (3.0.0) lib/rails/application.rb:77:in method_missing' railties (3.0.0) lib/rails/rack/log_tailer.rb:14:incall’
rack (1.2.1) lib/rack/content_length.rb:13:in call' rack (1.2.1) lib/rack/handler/webrick.rb:52:inservice’
/usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:111:in service' /usr/local/lib/ruby/1.9.1/webrick/httpserver.rb:70:inrun’
/usr/local/lib/ruby/1.9.1/webrick/server.rb:183:in `block in
start_thread’


With Advance Thanks,
Palani Kannan. K

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs