Communities

Writing
Writing
Codidact Meta
Codidact Meta
The Great Outdoors
The Great Outdoors
Photography & Video
Photography & Video
Scientific Speculation
Scientific Speculation
Cooking
Cooking
Electrical Engineering
Electrical Engineering
Judaism
Judaism
Languages & Linguistics
Languages & Linguistics
Software Development
Software Development
Mathematics
Mathematics
Christianity
Christianity
Code Golf
Code Golf
Music
Music
Physics
Physics
Linux Systems
Linux Systems
Power Users
Power Users
Tabletop RPGs
Tabletop RPGs
Community Proposals
Community Proposals
tag:snake search within a tag
answers:0 unanswered questions
user:xxxx search by author id
score:0.5 posts with 0.5+ score
"snake oil" exact phrase
votes:4 posts with 4+ votes
created:<1w created < 1 week ago
post_type:xxxx type of post
Search help
Notifications
Mark all as read See all your notifications »
Q&A

Post History

#3: Post edited by user avatar Trilarion‭ · 2022-01-13T21:01:34Z (over 2 years ago)
  • I'm setting up a QPixel instance. I just created a new category and I realized in the `rails s` output a NameError in avatar_helper.rb:
  • ```
  • Started GET "/users/1/avatar/40.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Started GET "/assets/codidact.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Processing by UsersController#avatar as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User Load (4.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
  • CommunityUser Load (5.6ms) SELECT `community_users`.* FROM `community_users` WHERE `community_users`.`user_id` = 1 AND `community_users`.`community_id` = 1 LIMIT 1
  • User 1 (aaa) signed in
  • ....
  • NameError (undefined local variable or method `background' for #<#<Class:0x00007f2dad266998>:0x00007f2dacaeec38>):
  • app/helpers/users/avatar_helper.rb:28:in `block in user_auto_avatar'
  • config/initializers/namespaced_cache.rb:11:in `block (2 levels) in <class:NamespacedEnvCache>'
  • app/helpers/users/avatar_helper.rb:23:in `user_auto_avatar'
  • app/controllers/users_controller.rb:474:in `block (2 levels) in avatar'
  • app/controllers/users_controller.rb:471:in `avatar'
  • Processing by ErrorsController#error as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User 1 (aaa) signed in
  • ...
  • Completed 500 Internal Server Error in 214ms (Views: 126.5ms | ActiveRecord: 25.9ms)
  • ```
  • I haven't set an avatar yet and the page output looks okay too (no error message visible, but also no avatar image).
  • Is it critical? Should I do something?
  • I'm setting up a QPixel instance. I just created a new category and I realized in the `rails s` output a NameError in avatar_helper.rb:
  • ```
  • Started GET "/users/1/avatar/40.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Started GET "/assets/codidact.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Processing by UsersController#avatar as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User Load (4.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
  • CommunityUser Load (5.6ms) SELECT `community_users`.* FROM `community_users` WHERE `community_users`.`user_id` = 1 AND `community_users`.`community_id` = 1 LIMIT 1
  • User 1 (aaa) signed in
  • ....
  • NameError (undefined local variable or method `background' for #<#<Class:0x00007f2dad266998>:0x00007f2dacaeec38>):
  • app/helpers/users/avatar_helper.rb:28:in `block in user_auto_avatar'
  • config/initializers/namespaced_cache.rb:11:in `block (2 levels) in <class:NamespacedEnvCache>'
  • app/helpers/users/avatar_helper.rb:23:in `user_auto_avatar'
  • app/controllers/users_controller.rb:474:in `block (2 levels) in avatar'
  • app/controllers/users_controller.rb:471:in `avatar'
  • Processing by ErrorsController#error as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User 1 (aaa) signed in
  • ...
  • Completed 500 Internal Server Error in 214ms (Views: 126.5ms | ActiveRecord: 25.9ms)
  • ```
  • I haven't set an avatar yet and the page output looks okay too (no error message visible, but also no avatar image).
  • Is it critical? Should I do something?
  • ----
  • Tried to fix it and created a [PR](https://github.com/codidact/qpixel/pull/758).
#2: Post edited by user avatar Trilarion‭ · 2022-01-13T11:36:46Z (over 2 years ago)
  • I'm setting up a QPixel instance. I just created a new category and I realized in the `rails s` output a NameError in avatar_helper.rb:
  • ```
  • Started GET "/users/1/avatar/40.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Started GET "/assets/codidact.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Processing by UsersController#avatar as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User Load (4.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
  • CommunityUser Load (5.6ms) SELECT `community_users`.* FROM `community_users` WHERE `community_users`.`user_id` = 1 AND `community_users`.`community_id` = 1 LIMIT 1
  • User 1 (aaa) signed in
  • ....
  • NameError (undefined local variable or method `background' for #<#<Class:0x00007f2dad266998>:0x00007f2dacaeec38>):
  • app/helpers/users/avatar_helper.rb:28:in `block in user_auto_avatar'
  • config/initializers/namespaced_cache.rb:11:in `block (2 levels) in <class:NamespacedEnvCache>'
  • app/helpers/users/avatar_helper.rb:23:in `user_auto_avatar'
  • app/controllers/users_controller.rb:474:in `block (2 levels) in avatar'
  • app/controllers/users_controller.rb:471:in `avatar'
  • Processing by ErrorsController#error as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User 1 (aaa) signed in
  • ...
  • Completed 500 Internal Server Error in 214ms (Views: 126.5ms | ActiveRecord: 25.9ms)
  • ```
  • I haven't set an avatar yet and the page output looks fine to (no error message visible).
  • Is it critical? Should I do something?
  • I'm setting up a QPixel instance. I just created a new category and I realized in the `rails s` output a NameError in avatar_helper.rb:
  • ```
  • Started GET "/users/1/avatar/40.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Started GET "/assets/codidact.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
  • Processing by UsersController#avatar as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User Load (4.4ms) SELECT `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
  • CommunityUser Load (5.6ms) SELECT `community_users`.* FROM `community_users` WHERE `community_users`.`user_id` = 1 AND `community_users`.`community_id` = 1 LIMIT 1
  • User 1 (aaa) signed in
  • ....
  • NameError (undefined local variable or method `background' for #<#<Class:0x00007f2dad266998>:0x00007f2dacaeec38>):
  • app/helpers/users/avatar_helper.rb:28:in `block in user_auto_avatar'
  • config/initializers/namespaced_cache.rb:11:in `block (2 levels) in <class:NamespacedEnvCache>'
  • app/helpers/users/avatar_helper.rb:23:in `user_auto_avatar'
  • app/controllers/users_controller.rb:474:in `block (2 levels) in avatar'
  • app/controllers/users_controller.rb:471:in `avatar'
  • Processing by ErrorsController#error as PNG
  • Parameters: {"id"=>"1", "size"=>"40"}
  • Host localhost:3000, community #1 (Dev Community)
  • User 1 (aaa) signed in
  • ...
  • Completed 500 Internal Server Error in 214ms (Views: 126.5ms | ActiveRecord: 25.9ms)
  • ```
  • I haven't set an avatar yet and the page output looks okay too (no error message visible, but also no avatar image).
  • Is it critical? Should I do something?
#1: Initial revision by user avatar Trilarion‭ · 2022-01-12T21:43:09Z (over 2 years ago)
How to fix NameError (undefined local variable or method `background' for #<#<Class) in avatar_helper.rb?
I'm setting up a QPixel instance. I just created a new category and I realized in the `rails s` output a NameError in avatar_helper.rb:

```
Started GET "/users/1/avatar/40.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
Started GET "/assets/codidact.png" for 127.0.0.1 at 2022-01-12 22:37:01 +0100
Processing by UsersController#avatar as PNG
  Parameters: {"id"=>"1", "size"=>"40"}
  Host localhost:3000, community #1 (Dev Community)
  User Load (4.4ms)  SELECT  `users`.* FROM `users` WHERE `users`.`id` = 1 ORDER BY `users`.`id` ASC LIMIT 1
  CommunityUser Load (5.6ms)  SELECT  `community_users`.* FROM `community_users` WHERE `community_users`.`user_id` = 1 AND `community_users`.`community_id` = 1 LIMIT 1
  User 1 (aaa) signed in
  ....
NameError (undefined local variable or method `background' for #<#<Class:0x00007f2dad266998>:0x00007f2dacaeec38>):

app/helpers/users/avatar_helper.rb:28:in `block in user_auto_avatar'
config/initializers/namespaced_cache.rb:11:in `block (2 levels) in <class:NamespacedEnvCache>'
app/helpers/users/avatar_helper.rb:23:in `user_auto_avatar'
app/controllers/users_controller.rb:474:in `block (2 levels) in avatar'
app/controllers/users_controller.rb:471:in `avatar'
Processing by ErrorsController#error as PNG
  Parameters: {"id"=>"1", "size"=>"40"}
  Host localhost:3000, community #1 (Dev Community)
  User 1 (aaa) signed in
  ...
Completed 500 Internal Server Error in 214ms (Views: 126.5ms | ActiveRecord: 25.9ms)
```

I haven't set an avatar yet and the page output looks fine to (no error message visible).

Is it critical? Should I do something?