RailsCasts Pro episodes are now free!
Learn more or hide this
GitHub User: janchiks
followed the tutorial, but for the life of me cannot get this to work on rails 3.2.13 and ruby 2.0.0. basically i get the following error with the controller's 'show' action:
ActiveRecord::RecordNotFound - Couldn't find Artwork with id=pirmais: (gem) activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:343:in find_one' (gem) activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:314:infind_with_ids' (gem) activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:107:in find' (gem) activerecord-3.2.13/lib/active_record/querying.rb:5:infind' (gem) cancan-1.6.9/lib/cancan/model_adapters/abstract_adapter.rb:20:in find' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:114:infind_resource' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:68:in load_resource_instance' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:32:inload_resource' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:25:in load_and_authorize_resource' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:10:inblock in add_before_filter' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:451:in _run__369076481886043173__process_action__2635143404322980588__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:inrun_callback' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in _run_process_action_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:inrun_callbacks' (gem) actionpack-3.2.13/lib/abstract_controller/callbacks.rb:17:in process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/rescue.rb:29:inprocess_action' (gem) actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:30:in block in process_action' (gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:inblock in instrument' (gem) activesupport-3.2.13/lib/active_support/notifications/instrumenter.rb:20:in instrument' (gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:ininstrument' (gem) actionpack-3.2.13/lib/action_controller/metal/instrumentation.rb:29:in process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:207:inprocess_action' (gem) activerecord-3.2.13/lib/active_record/railties/controller_runtime.rb:18:in process_action' (gem) actionpack-3.2.13/lib/abstract_controller/base.rb:121:inprocess' (gem) actionpack-3.2.13/lib/abstract_controller/rendering.rb:45:in process' (gem) actionpack-3.2.13/lib/action_controller/metal.rb:203:indispatch' (gem) actionpack-3.2.13/lib/action_controller/metal/rack_delegation.rb:14:in dispatch' (gem) actionpack-3.2.13/lib/action_controller/metal.rb:246:inblock in action' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in call' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:indispatch' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:36:in call' (gem) journey-1.0.4/lib/journey/router.rb:68:inblock in call' (gem) journey-1.0.4/lib/journey/router.rb:56:in each' (gem) journey-1.0.4/lib/journey/router.rb:56:incall' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:612:in call' (gem) warden-1.2.1/lib/warden/manager.rb:35:inblock in call' (gem) warden-1.2.1/lib/warden/manager.rb:34:in catch' (gem) warden-1.2.1/lib/warden/manager.rb:34:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/best_standards_support.rb:17:in call' (gem) rack-1.4.5/lib/rack/etag.rb:23:incall' (gem) rack-1.4.5/lib/rack/conditionalget.rb:25:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/params_parser.rb:21:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:incall' (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:210:in context' (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/cookies.rb:341:in call' (gem) activerecord-3.2.13/lib/active_record/query_cache.rb:64:incall' (gem) activerecord-3.2.13/lib/active_record/connection_adapters/abstract/connection_pool.rb:479:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:inblock in call' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in _run__4384397577656740839__call__2610537326534929259__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:inrun_callback' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:385:in _run_call_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:inrun_callbacks' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:27:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:65:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/remote_ip.rb:31:in call' (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:84:inprotected_app_call' (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:79:in better_errors_call' (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:56:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/debug_exceptions.rb:16:in call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:incall' (gem) railties-3.2.13/lib/rails/rack/logger.rb:32:in call_app' (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:inblock in call' (gem) activesupport-3.2.13/lib/active_support/tagged_logging.rb:22:in tagged' (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:incall' (gem) quiet_assets-1.0.2/lib/quiet_assets.rb:18:in call_with_quiet_assets' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:incall' (gem) rack-1.4.5/lib/rack/methodoverride.rb:21:in call' (gem) rack-1.4.5/lib/rack/runtime.rb:17:incall' (gem) activesupport-3.2.13/lib/active_support/cache/strategy/local_cache.rb:72:in call' (gem) rack-1.4.5/lib/rack/lock.rb:15:incall' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/static.rb:63:in call' (gem) railties-3.2.13/lib/rails/engine.rb:479:incall' (gem) railties-3.2.13/lib/rails/application.rb:223:in call' (gem) rack-1.4.5/lib/rack/content_length.rb:14:incall' (gem) railties-3.2.13/lib/rails/rack/log_tailer.rb:17:in call' (gem) rack-1.4.5/lib/rack/handler/webrick.rb:59:inservice' /Users/janis/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:138:in service' /Users/janis/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:94:inrun' /Users/janis/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/server.rb:295:in `block in start_thread'
find_one' (gem) activerecord-3.2.13/lib/active_record/relation/finder_methods.rb:314:in
find' (gem) activerecord-3.2.13/lib/active_record/querying.rb:5:in
find' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:114:in
load_resource_instance' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:32:in
load_and_authorize_resource' (gem) cancan-1.6.9/lib/cancan/controller_resource.rb:10:in
_run__369076481886043173__process_action__2635143404322980588__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in
_run_process_action_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in
process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/rescue.rb:29:in
block in process_action' (gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in
instrument' (gem) activesupport-3.2.13/lib/active_support/notifications.rb:123:in
process_action' (gem) actionpack-3.2.13/lib/action_controller/metal/params_wrapper.rb:207:in
process_action' (gem) actionpack-3.2.13/lib/abstract_controller/base.rb:121:in
process' (gem) actionpack-3.2.13/lib/action_controller/metal.rb:203:in
dispatch' (gem) actionpack-3.2.13/lib/action_controller/metal.rb:246:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/routing/route_set.rb:73:in
call' (gem) journey-1.0.4/lib/journey/router.rb:68:in
each' (gem) journey-1.0.4/lib/journey/router.rb:56:in
call' (gem) warden-1.2.1/lib/warden/manager.rb:35:in
catch' (gem) warden-1.2.1/lib/warden/manager.rb:34:in
call' (gem) rack-1.4.5/lib/rack/etag.rb:23:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/head.rb:14:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/flash.rb:242:in
context' (gem) rack-1.4.5/lib/rack/session/abstract/id.rb:205:in
call' (gem) activerecord-3.2.13/lib/active_record/query_cache.rb:64:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/callbacks.rb:28:in
_run__4384397577656740839__call__2610537326534929259__callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:405:in
_run_call_callbacks' (gem) activesupport-3.2.13/lib/active_support/callbacks.rb:81:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/reloader.rb:65:in
call' (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:84:in
better_errors_call' (gem) better_errors-0.8.0/lib/better_errors/middleware.rb:56:in
call' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/show_exceptions.rb:56:in
call_app' (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:in
tagged' (gem) railties-3.2.13/lib/rails/rack/logger.rb:16:in
call_with_quiet_assets' (gem) actionpack-3.2.13/lib/action_dispatch/middleware/request_id.rb:22:in
call' (gem) rack-1.4.5/lib/rack/runtime.rb:17:in
call' (gem) rack-1.4.5/lib/rack/lock.rb:15:in
call' (gem) railties-3.2.13/lib/rails/engine.rb:479:in
call' (gem) rack-1.4.5/lib/rack/content_length.rb:14:in
call' (gem) rack-1.4.5/lib/rack/handler/webrick.rb:59:in
service' /Users/janis/.rvm/rubies/ruby-2.0.0-p0/lib/ruby/2.0.0/webrick/httpserver.rb:94:in
and from what i understand there is problem with this line in: (gem) activerecord-3.2.13/lib/active_record/relation/finder_methods.rb
343 raise RecordNotFound, "Couldn't find #{@klass.name} with #{primary_key}=#{id}#{conditions}"
Any help appreciated. by the way, had the same error when tried to implement friendly_id gem.
followed the tutorial, but for the life of me cannot get this to work on rails 3.2.13 and ruby 2.0.0.
basically i get the following error with the controller's 'show' action:
and from what i understand there is problem with this line in:
(gem) activerecord-3.2.13/lib/active_record/relation/finder_methods.rb
Any help appreciated. by the way, had the same error when tried to implement friendly_id gem.