Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Ruby

ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?]

After importing avatar my statuses is not working it's giving me error

undefined method `avatar?' for nil:NilClass

$rake import_avatars

 Importing avatars from gravatar

....Avatars update

My git repository is at: https://github.com/sarahgupta022/book.git

i'm surrounded with lots of error and now i'm confused how to remove all the error.

$rake test

DL is deprecated, please use Fiddle

Run options: --seed 12162

 # Running:

.......................................FEEEEEEE..E..EE...............................F....F...................F.F......................

Finished in 18.629710s, 7.2465 runs/s, 11.0039 assertions/s

1) Failure:

StatusesControllerTest#test_should_update_status_for_the_current_user_when_logged_in [C:/Users/Arvind/project/book/test/controllers/statuses_contr oller_test.rb:105]: Expected response to be a <error>, but was <302>

2) Error:

PicturesControllerTest#test_should_get_edit:

ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:127:in find_album' test/controllers/pictures_controller_test.rb:39:inblock in <class:PicturesControllerTest>'

3) Error:

PicturesControllerTest#test_should_destroy_picture: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:127:in find_album' test/controllers/pictures_controller_test.rb:52:inblock (2 levels) in <class:PicturesControllerTest>' test/controllers/pictures_controller_test.rb:51:in `block in <class:PicturesControllerTest>'

4) Error:

PicturesControllerTest#test_should_create_picture: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:127:in find_album' test/controllers/pictures_controller_test.rb:26:inblock (2 levels) in <class:PicturesControllerTest>' test/controllers/pictures_controller_test.rb:25:in `block in <class:PicturesControllerTest>'

5) Error:

PicturesControllerTest#test_should_get_index: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:129:in find_album' test/controllers/pictures_controller_test.rb:12:inblock in <class:PicturesControllerTest>'

6) Error:

PicturesControllerTest#test_should_update_picture: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:127:in find_album' test/controllers/pictures_controller_test.rb:45:inblock in <class:PicturesControllerTest>'

7) Error:

PicturesControllerTest#test_should_show_picture: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:129:in find_album' test/controllers/pictures_controller_test.rb:33:inblock in <class:PicturesControllerTest>'

8) Error:

PicturesControllerTest#test_should_get_new: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/pictures_controller.rb:127:in find_album' test/controllers/pictures_controller_test.rb:19:inblock in <class:PicturesControllerTest>'

9) Error:

AlbumsControllerTest#test_should_destroy_album: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/albums_controller.rb:114:in find_album' test/controllers/albums_controller_test.rb:51:inblock (2 levels) in <class:AlbumsControllerTest>' test/controllers/albums_controller_test.rb:50:in `block in <class:AlbumsControllerTest>'

10) Error:

AlbumsControllerTest#test_should_get_edit: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/albums_controller.rb:114:in find_album' test/controllers/albums_controller_test.rb:38:inblock in <class:AlbumsControllerTest>'

11) Error:

AlbumsControllerTest#test_should_update_album: ActiveRecord::RecordNotFound: Couldn't find Album with 'id'=601546616 [WHERE "albums"."user_id" = ?] app/controllers/albums_controller.rb:114:in find_album' test/controllers/albums_controller_test.rb:44:inblock in <class:AlbumsControllerTest>'

12) Failure:

UserFriendshipsControllerTest#test_: #index when logged in accepted friendships should not display pending or active friend's names. [C:/Users/Ar vind/project/book/test/controllers/user_friendships_controller_test.rb:115]: Expected /Blocked/ to not match "<!DOCTYPE html>\n<html>\n<head>\n <title>Friendsbook</title>\n <link rel=\"stylesheet\" media=\"all\" href=\"/a ssets/application.css\" data-turbolinks-track=\"true\" />\n <script src=\"/assets/application.js\" data-turbolinks-track=\"true\"></script>\n \n </head>\n<body>\n\t<div class=\"navbar navbar-fixed-top\">\n\t\t<div class=\"navbar-inner\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<a href=\"# \" class=\"brand\">Friendbook</a>\n\t\t\t\t<ul class=\"nav\">\n\t\t\t\t\t<li><a href=\"/statuses\">All Statuses</a></li>\n\t\t\t\t\t\t</ul>\n\t\t\ t\t\t\t<ul class=\"nav pull-right\">\n\t\t\t\t\t\t\t<li><a href=\"/sarahgupta/albums\">Albums</a></li>\n\t\t\t\t\t\t\t<li><a href=\"/user_friendsh ips\">Friends</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/users/edit\">Sarah Gupta</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/logout\">Log Out </a></li>\n\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t<div class=\"container\">\n\t\t\n \n<div class=\"page-header\">\n\t<h1>Friends</h1>\n< /div>\n\n<div>\n\t<strong>Friend list:</strong>\n\t<a href=\"/user_friendships?list=blocked\">Blocked</a>\n\t<a href=\"/user_friendships?list=requ ested\">Requested</a>\n\t<a href=\"/user_friendships?list=accepted\">Accepted</a>\n\t<a href=\"/user_friendships?list=pending\">Pending</a>\n</div

\n\n<div id=\"user_friendship_980190962\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/ruby\"><img src=\"http://gravatar.com/a vatar/6b773ed47572821c83c54e87f36dbef6\" alt=\"6b773ed47572821c83c54e87f36dbef6\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Ruby Gup ta </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_850515968\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/youb lockedme\"><img src=\"http://gravatar.com/avatar/b975cfb771516f5742cd1fbda6e0fb30\" alt=\"B975cfb771516f5742cd1fbda6e0fb30\" /></a>\n\t</div>\n\t< div class=\"span7\">\n\t\t<strong> Blocked Friend </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_980190963\" class=\"friend row\" \n\t<div class=\"span1\">\n\t\t<a href=\"/user34\"><img src=\"http://gravatar.com/avatar/8b5770882d6991af57d599e502429380\" alt=\"8b5770882d6991a f57d599e502429380\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Pending Friend </strong> <br />\n\t\t<em>Friendship is pending.</em> < a href=\"/user_friendships/user34/edit\">Delete request</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190964\" class=\"friend row\" >\n\t< div class=\"span1\">\n\t\t<a href=\"/user35\"><img src=\"http://gravatar.com/avatar/913b2db075de4347d209fae0e31b2125\" alt=\"913b2db075de4347d209f ae0e31b2125\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Active Friend </strong> <br />\n\t\t<em>Friendship started 2015-06-17 00:55: 03 UTC.</em> <a href=\"/user_friendships/user35/edit\">Update friendship</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190965\" class=\"fr iend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/user36\"><img src=\"http://gravatar.com/avatar/12ccb85a406fdf3dacf1e0906495e9f6\" alt=\"12cc b85a406fdf3dacf1e0906495e9f6\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Requested Friend </strong> <br />\n\t\t<em>Friendship reque sted.</em> <a href=\"/user_friendships/user36/edit\">Accept Friendship</a>.\n\t</div>\n </div>\n\n\n\n</div>\n</body>\n</html>\n".

13) Failure:

UserFriendshipsControllerTest#test_: #index when logged in pending friendships should not display pending or active friend's names. [C:/Users/Arv ind/project/book/test/controllers/user_friendships_controller_test.rb:77]: Expected /Blocked/ to not match "<!DOCTYPE html>\n<html>\n<head>\n <title>Friendsbook</title>\n <link rel=\"stylesheet\" media=\"all\" href=\"/a ssets/application.css\" data-turbolinks-track=\"true\" />\n <script src=\"/assets/application.js\" data-turbolinks-track=\"true\"></script>\n \n </head>\n<body>\n\t<div class=\"navbar navbar-fixed-top\">\n\t\t<div class=\"navbar-inner\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<a href=\"# \" class=\"brand\">Friendbook</a>\n\t\t\t\t<ul class=\"nav\">\n\t\t\t\t\t<li><a href=\"/statuses\">All Statuses</a></li>\n\t\t\t\t\t\t</ul>\n\t\t\ t\t\t\t<ul class=\"nav pull-right\">\n\t\t\t\t\t\t\t<li><a href=\"/sarahgupta/albums\">Albums</a></li>\n\t\t\t\t\t\t\t<li><a href=\"/user_friendsh ips\">Friends</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/users/edit\">Sarah Gupta</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/logout\">Log Out </a></li>\n\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t<div class=\"container\">\n\t\t\n \n<div class=\"page-header\">\n\t<h1>Friends</h1>\n< /div>\n\n<div>\n\t<strong>Friend list:</strong>\n\t<a href=\"/user_friendships?list=blocked\">Blocked</a>\n\t<a href=\"/user_friendships?list=requ ested\">Requested</a>\n\t<a href=\"/user_friendships?list=accepted\">Accepted</a>\n\t<a href=\"/user_friendships?list=pending\">Pending</a>\n</div

\n\n<div id=\"user_friendship_980190962\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/ruby\"><img src=\"http://gravatar.com/a vatar/6b773ed47572821c83c54e87f36dbef6\" alt=\"6b773ed47572821c83c54e87f36dbef6\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Ruby Gup ta </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_850515968\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/youb lockedme\"><img src=\"http://gravatar.com/avatar/b975cfb771516f5742cd1fbda6e0fb30\" alt=\"B975cfb771516f5742cd1fbda6e0fb30\" /></a>\n\t</div>\n\t< div class=\"span7\">\n\t\t<strong> Blocked Friend </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_980190963\" class=\"friend row\" \n\t<div class=\"span1\">\n\t\t<a href=\"/user39\"><img src=\"http://gravatar.com/avatar/8f896ea086e84e27c6b2ae09bb5aea50\" alt=\"8f896ea086e84e2 7c6b2ae09bb5aea50\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Pending Friend </strong> <br />\n\t\t<em>Friendship is pending.</em> < a href=\"/user_friendships/user39/edit\">Delete request</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190964\" class=\"friend row\" >\n\t< div class=\"span1\">\n\t\t<a href=\"/user40\"><img src=\"http://gravatar.com/avatar/f3ff0b7288ed70951db716370170b977\" alt=\"F3ff0b7288ed70951db71 6370170b977\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Active Friend </strong> <br />\n\t\t<em>Friendship started 2015-06-17 00:55: 04 UTC.</em> <a href=\"/user_friendships/user40/edit\">Update friendship</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190965\" class=\"fr iend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/user41\"><img src=\"http://gravatar.com/avatar/c6eaaacce5751d42718f2821ec50bc3a\" alt=\"C6ea aacce5751d42718f2821ec50bc3a\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Requested Friend </strong> <br />\n\t\t<em>Friendship reque sted.</em> <a href=\"/user_friendships/user41/edit\">Accept Friendship</a>.\n\t</div>\n </div>\n\n\n\n</div>\n</body>\n</html>\n".

14) Failure:

UserFriendshipsControllerTest#test_: #index when logged in blocked users should not display pending or active friend's names. [C:/Users/Arvind/pr oject/book/test/controllers/user_friendships_controller_test.rb:58]: Expected /Pending\ Friend/ to not match "<!DOCTYPE html>\n<html>\n<head>\n <title>Friendsbook</title>\n <link rel=\"stylesheet\" media=\"all\" h ref=\"/assets/application.css\" data-turbolinks-track=\"true\" />\n <script src=\"/assets/application.js\" data-turbolinks-track=\"true\"></scrip t>\n \n</head>\n<body>\n\t<div class=\"navbar navbar-fixed-top\">\n\t\t<div class=\"navbar-inner\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<a href=\"#\" class=\"brand\">Friendbook</a>\n\t\t\t\t<ul class=\"nav\">\n\t\t\t\t\t<li><a href=\"/statuses\">All Statuses</a></li>\n\t\t\t\t\t\t</ul

\n\t\t\t\t\t\t<ul class=\"nav pull-right\">\n\t\t\t\t\t\t\t<li><a href=\"/sarahgupta/albums\">Albums</a></li>\n\t\t\t\t\t\t\t<li><a href=\"/user_ friendships\">Friends</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/users/edit\">Sarah Gupta</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/logout\" Log Out</a></li>\n\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t<div class=\"container\">\n\t\t\n \n<div class=\"page-header\">\n\t<h1>Friends </h1>\n</div>\n\n<div>\n\t<strong>Friend list:</strong>\n\t<a href=\"/user_friendships?list=blocked\">Blocked</a>\n\t<a href=\"/user_friendships?l ist=requested\">Requested</a>\n\t<a href=\"/user_friendships?list=accepted\">Accepted</a>\n\t<a href=\"/user_friendships?list=pending\">Pending</a \n</div>\n\n<div id=\"user_friendship_980190962\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/ruby\"><img src=\"http://gravat ar.com/avatar/6b773ed47572821c83c54e87f36dbef6\" alt=\"6b773ed47572821c83c54e87f36dbef6\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Ruby Gupta </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_850515968\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href =\"/youblockedme\"><img src=\"http://gravatar.com/avatar/b975cfb771516f5742cd1fbda6e0fb30\" alt=\"B975cfb771516f5742cd1fbda6e0fb30\" /></a>\n\t</d iv>\n\t<div class=\"span7\">\n\t\t<strong> Blocked Friend </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_980190963\" class=\"frien d row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/user62\"><img src=\"http://gravatar.com/avatar/ad46b04563ff75eee454bf154da8116a\" alt=\"Ad46b04 563ff75eee454bf154da8116a\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Pending Friend </strong> <br />\n\t\t<em>Friendship is pending .</em> <a href=\"/user_friendships/user62/edit\">Delete request</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190964\" class=\"friend row\ " >\n\t<div class=\"span1\">\n\t\t<a href=\"/user63\"><img src=\"http://gravatar.com/avatar/712336b091ee95d30dfe922e1f8659f3\" alt=\"712336b091ee9 5d30dfe922e1f8659f3\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Active Friend </strong> <br />\n\t\t<em>Friendship started 2015-06-1 7 00:55:08 UTC.</em> <a href=\"/user_friendships/user63/edit\">Update friendship</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190965\" cl ass=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/user64\"><img src=\"http://gravatar.com/avatar/c03ddd54e213b402b08c31162f117435\" al t=\"C03ddd54e213b402b08c31162f117435\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Requested Friend </strong> <br />\n\t\t<em>Friendsh ip requested.</em> <a href=\"/user_friendships/user64/edit\">Accept Friendship</a>.\n\t</div>\n </div>\n\n\n\n</div>\n</body>\n</html>\n".

15) Failure:

UserFriendshipsControllerTest#test_: #index when logged in requested friendships should not display pending or active friend's names. [C:/Users/A rvind/project/book/test/controllers/user_friendships_controller_test.rb:96]: Expected /Blocked/ to not match "<!DOCTYPE html>\n<html>\n<head>\n <title>Friendsbook</title>\n <link rel=\"stylesheet\" media=\"all\" href=\"/a ssets/application.css\" data-turbolinks-track=\"true\" />\n <script src=\"/assets/application.js\" data-turbolinks-track=\"true\"></script>\n \n </head>\n<body>\n\t<div class=\"navbar navbar-fixed-top\">\n\t\t<div class=\"navbar-inner\">\n\t\t\t<div class=\"container\">\n\t\t\t\t<a href=\"# \" class=\"brand\">Friendbook</a>\n\t\t\t\t<ul class=\"nav\">\n\t\t\t\t\t<li><a href=\"/statuses\">All Statuses</a></li>\n\t\t\t\t\t\t</ul>\n\t\t\ t\t\t\t<ul class=\"nav pull-right\">\n\t\t\t\t\t\t\t<li><a href=\"/sarahgupta/albums\">Albums</a></li>\n\t\t\t\t\t\t\t<li><a href=\"/user_friendsh ips\">Friends</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/users/edit\">Sarah Gupta</a></li>\n\t\t\t\t\t\t\t <li><a href=\"/logout\">Log Out </a></li>\n\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t<div class=\"container\">\n\t\t\n \n<div class=\"page-header\">\n\t<h1>Friends</h1>\n< /div>\n\n<div>\n\t<strong>Friend list:</strong>\n\t<a href=\"/user_friendships?list=blocked\">Blocked</a>\n\t<a href=\"/user_friendships?list=requ ested\">Requested</a>\n\t<a href=\"/user_friendships?list=accepted\">Accepted</a>\n\t<a href=\"/user_friendships?list=pending\">Pending</a>\n</div

\n\n<div id=\"user_friendship_980190962\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/ruby\"><img src=\"http://gravatar.com/avatar/6b773ed47572821c83c54e87f36dbef6\" alt=\"6b773ed47572821c83c54e87f36dbef6\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Ruby Gup ta </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_850515968\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/youb lockedme\"><img src=\"http://gravatar.com/avatar/b975cfb771516f5742cd1fbda6e0fb30\" alt=\"B975cfb771516f5742cd1fbda6e0fb30\" /></a>\n\t</div>\n\t< div class=\"span7\">\n\t\t<strong> Blocked Friend </strong> <br />\n\t</div>\n </div>\n<div id=\"user_friendship_980190963\" class=\"friend row\" \n\t<div class=\"span1\">\n\t\t<a href=\"/user65\"><img src=\"http://gravatar.com/avatar/257869ed797d456b572572f01b08f24c\" alt=\"257869ed797d456 b572572f01b08f24c\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Pending Friend </strong> <br />\n\t\t<em>Friendship is pending.</em> < a href=\"/user_friendships/user65/edit\">Delete request</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190964\" class=\"friend row\" >\n\t< div class=\"span1\">\n\t\t<a href=\"/user66\"><img src=\"http://gravatar.com/avatar/90a0445d400f64323f54b1bc596e6372\" alt=\"90a0445d400f64323f54b 1bc596e6372\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Active Friend </strong> <br />\n\t\t<em>Friendship started 2015-06-17 00:55: 08 UTC.</em> <a href=\"/user_friendships/user66/edit\">Update friendship</a>.\n\t</div>\n </div>\n<div id=\"user_friendship_980190965\" class=\"friend row\" >\n\t<div class=\"span1\">\n\t\t<a href=\"/user67\"><img src=\"http://gravatar.com/avatar/1f55835d8231efd0fdee2bdf58139a59\" alt=\"1f55 835d8231efd0fdee2bdf58139a59\" /></a>\n\t</div>\n\t<div class=\"span7\">\n\t\t<strong> Requested Friend </strong> <br />\n\t\t<em>Friendship reque sted.</em> <a href=\"/user_friendships/user67/edit\">Accept Friendship</a>.\n\t</div>\n </div>\n\n\n\n</div>\n</body>\n</html>\n".

135 runs, 205 assertions, 5 failures, 10 errors, 0 skips

.