# \#bug

**URL:** https://discuss.rubyonrails.org/tag/bug/5.md

[Latest](https://discuss.rubyonrails.org/latest.md) · [Categories](https://discuss.rubyonrails.org/categories.md) · [Tags](https://discuss.rubyonrails.org/tags.md)

---

## [Has\_one :through always queries the database even when intermediate and target associations are already loaded](https://discuss.rubyonrails.org/t/has-one-through-always-queries-the-database-even-when-intermediate-and-target-associations-are-already-loaded/90244)

<div class="topic-metadata">

**Author:** [@Memli-Sheremeti](https://discuss.rubyonrails.org/u/Memli-Sheremeti)\
**Replies:** 1\
**Last updated:** [March 16, 2026, 1:36pm UTC](https://discuss.rubyonrails.org/t/has-one-through-always-queries-the-database-even-when-intermediate-and-target-associations-are-already-loaded/90244 "2026-03-16T13:36:45Z")

</div>

Hey everyone :waving\_hand:, My lead dev @jplot and I ran into something that surprised us while profiling N+1s in a production app. We have a pretty classic grandparent pattern — Account → Report → Issue — and we notice…

---

## [Bug with yarn and bun when running \`rails new\`](https://discuss.rubyonrails.org/t/bug-with-yarn-and-bun-when-running-rails-new/89092)

<div class="topic-metadata">

**Author:** [@j4321](https://discuss.rubyonrails.org/u/j4321)\
**Replies:** 4\
**Last updated:** [June 17, 2025, 11:33pm UTC](https://discuss.rubyonrails.org/t/bug-with-yarn-and-bun-when-running-rails-new/89092 "2025-06-17T23:33:46Z")

</div>

I think I’ve found a bug with the rails new command. When I run this command, it sets up the project with both yarn and bun, creating two lockfiles. rails new project\_name -j=esbuild -c=tailwind -d=postgresql Problems …

---

## [Existing cookies not decrypting after updating Rails 7.1.5.1 to 7.2.2.1](https://discuss.rubyonrails.org/t/existing-cookies-not-decrypting-after-updating-rails-7-1-5-1-to-7-2-2-1/88447)

<div class="topic-metadata">

**Author:** [@hakunin](https://discuss.rubyonrails.org/u/hakunin)\
**Replies:** 7\
**Last updated:** [February 14, 2025, 1:10am UTC](https://discuss.rubyonrails.org/t/existing-cookies-not-decrypting-after-updating-rails-7-1-5-1-to-7-2-2-1/88447 "2025-02-14T01:10:56Z")

</div>

Anybody encountered this? I made a step-up update from Rails 7.1.5.1 to 7.2.2.1 (on my way to Rails 8). Didn’t touch any Message Encryptor/Verifier related settings, not that I’d set any in the first place. Didn’t chang…

---

## [Destroy-callbacks not working with PostgreSQL but works fine with sqlite3](https://discuss.rubyonrails.org/t/destroy-callbacks-not-working-with-postgresql-but-works-fine-with-sqlite3/88467)

<div class="topic-metadata">

**Author:** [@alec-c4](https://discuss.rubyonrails.org/u/alec-c4)\
**Replies:** 2\
**Last updated:** [January 22, 2025, 11:22am UTC](https://discuss.rubyonrails.org/t/destroy-callbacks-not-working-with-postgresql-but-works-fine-with-sqlite3/88467 "2025-01-22T11:22:04Z")

</div>

Hi. I met a very interesting issue related to destroy-callbacks in apps backed with PostgreSQL database. To check this issue, you can create a new app from scratch using rails new testapp -d postgresql, then create a new…

---

## [Unexpected behavior in locking\_enabled? Returning column object instead of boolean](https://discuss.rubyonrails.org/t/unexpected-behavior-in-locking-enabled-returning-column-object-instead-of-boolean/88049)

<div class="topic-metadata">

**Author:** [@Grigore-George-Mihai](https://discuss.rubyonrails.org/u/Grigore-George-Mihai)\
**Replies:** 2\
**Last updated:** [December 12, 2024, 3:11am UTC](https://discuss.rubyonrails.org/t/unexpected-behavior-in-locking-enabled-returning-column-object-instead-of-boolean/88049 "2024-12-12T03:11:03Z")

</div>

I am working on a Rails application and encountered an issue with the locking\_enabled? method in ActiveRecord. Instead of returning a boolean as expected, it is returning an ActiveRecord::ConnectionAdapters::PostgreSQL::…

---

## ["field\_with\_errors" divs corrupts layout of "collection\_check\_boxes"](https://discuss.rubyonrails.org/t/field-with-errors-divs-corrupts-layout-of-collection-check-boxes/87807)

<div class="topic-metadata">

**Author:** [@manuelbeck](https://discuss.rubyonrails.org/u/manuelbeck)\
**Replies:** 1\
**Last updated:** [November 9, 2024, 3:44pm UTC](https://discuss.rubyonrails.org/t/field-with-errors-divs-corrupts-layout-of-collection-check-boxes/87807 "2024-11-09T15:44:07Z")

</div>

If a user don’t check anything in a obligatory collection\_check\_boxes field, every input of collection\_check\_boxes gets surrounded by a \<div class="field\_with\_errors"\> which corrupts the layout of the checkboxes. When no…

---

## [ActiveRecord#merge not using table alias](https://discuss.rubyonrails.org/t/activerecord-merge-not-using-table-alias/87593)

<div class="topic-metadata">

**Author:** [@alanoliveira](https://discuss.rubyonrails.org/u/alanoliveira)\
**Replies:** 1\
**Last updated:** [October 7, 2024, 10:37am UTC](https://discuss.rubyonrails.org/t/activerecord-merge-not-using-table-alias/87593 "2024-10-07T10:37:14Z")

</div>

This is related to this github issue, I would like to confirm if it is a bug or the expected behavior. ActiveRecord#merge not uses the table alias. It makes the query throw an ActiveRecord::StatementInvalid when it is …

---

## [Writebook can not support traditional chinese input](https://discuss.rubyonrails.org/t/writebook-can-not-support-traditional-chinese-input/87585)

<div class="topic-metadata">

**Author:** [@Nickle](https://discuss.rubyonrails.org/u/Nickle)\
**Replies:** 1\
**Last updated:** [October 6, 2024, 9:41pm UTC](https://discuss.rubyonrails.org/t/writebook-can-not-support-traditional-chinese-input/87585 "2024-10-06T21:41:32Z")

</div>

In text pages, switch to edit mode that can not input traditional chinese word. Figure like below, thanks ONCE! copy/paste is work anyway

---

## [Apply Rails backtrace cleaner to ActiveJob backtrace printout](https://discuss.rubyonrails.org/t/apply-rails-backtrace-cleaner-to-activejob-backtrace-printout/81905)

<div class="topic-metadata">

**Author:** [@warrenbhw](https://discuss.rubyonrails.org/u/warrenbhw)\
**Replies:** 0\
**Last updated:** [December 8, 2022, 12:18am UTC](https://discuss.rubyonrails.org/t/apply-rails-backtrace-cleaner-to-activejob-backtrace-printout/81905 "2022-12-08T00:18:54Z")

</div>

ActiveJob produces a large amount of log noise, because errors that are emitted from ActiveJob don’t have the standard Rails BacktraceCleaner applied. This is especially apparent when using Sorbet for Ruby types. The …

---

## [A fix proposal for ActiveRecord::Persistence](https://discuss.rubyonrails.org/t/a-fix-proposal-for-activerecord-persistence/81893)

<div class="topic-metadata">

**Author:** [@dmytro.savochkin](https://discuss.rubyonrails.org/u/dmytro.savochkin)\
**Replies:** 0\
**Last updated:** [December 6, 2022, 9:37am UTC](https://discuss.rubyonrails.org/t/a-fix-proposal-for-activerecord-persistence/81893 "2022-12-06T09:37:29Z")

</div>

Hey! Writing here because “Contributing to RoR” guide says that if there is no feedback on your PR for Rails for some time you can “nudge things along” in this mailing list :slight\_smile: So here is my PR: Ensure \`relo…

---

## [Mini\_magick is required inside \`download\_blob\_to\_tempfile\` block but used outside](https://discuss.rubyonrails.org/t/mini-magick-is-required-inside-download-blob-to-tempfile-block-but-used-outside/80867)

<div class="topic-metadata">

**Author:** [@joelcogen](https://discuss.rubyonrails.org/u/joelcogen)\
**Replies:** 8\
**Last updated:** [June 21, 2022, 1:37pm UTC](https://discuss.rubyonrails.org/t/mini-magick-is-required-inside-download-blob-to-tempfile-block-but-used-outside/80867 "2022-06-21T13:37:29Z")

</div>

In ActiveStorage::Analyzer::ImageAnalyzer::ImageMagick#read\_image require "mini\_magick" is called inside the block passed to download\_blob\_to\_tempfile. However, it is used outside that block at L30: rescue MiniMagick…

---

## [Upgraded to Rails 7 and it is super slow compared to before upgrade](https://discuss.rubyonrails.org/t/upgraded-to-rails-7-and-it-is-super-slow-compared-to-before-upgrade/80697)

<div class="topic-metadata">

**Author:** [@San\_Ji](https://discuss.rubyonrails.org/u/San_Ji)\
**Replies:** 2\
**Last updated:** [May 24, 2022, 5:02am UTC](https://discuss.rubyonrails.org/t/upgraded-to-rails-7-and-it-is-super-slow-compared-to-before-upgrade/80697 "2022-05-24T05:02:48Z")

</div>

Hey, I upgraded Ruby to version 3 recently on our production server. When we upgrade to Ruby 3, many gems have to be upgraded at once, including Rails. The request went from (before the upgrade): Started GET "/dashboar…

---

## [Zeitwerk, Rails, and path-based gems](https://discuss.rubyonrails.org/t/zeitwerk-rails-and-path-based-gems/80537)

<div class="topic-metadata">

**Author:** [@choubacha](https://discuss.rubyonrails.org/u/choubacha)\
**Replies:** 4\
**Last updated:** [May 2, 2022, 7:41pm UTC](https://discuss.rubyonrails.org/t/zeitwerk-rails-and-path-based-gems/80537 "2022-05-02T19:41:45Z")

</div>

We’ve been working on upgrading from rails 5 to rails 6. In preparation we’ve been setting up a number of gems that we use to load themselves with zeitwerk. The issue is that the rails zeitwerk loader is eager loading th…

---

## [Is there a bug with .where on polymorphic has\_one associations?](https://discuss.rubyonrails.org/t/is-there-a-bug-with-where-on-polymorphic-has-one-associations/79680)

<div class="topic-metadata">

**Author:** [@AlexBruns](https://discuss.rubyonrails.org/u/AlexBruns)\
**Replies:** 4\
**Last updated:** [January 5, 2022, 6:20pm UTC](https://discuss.rubyonrails.org/t/is-there-a-bug-with-where-on-polymorphic-has-one-associations/79680 "2022-01-05T18:20:43Z")

</div>

I’m usually not one to jump to “the library must have a bug” when my code breaks, but after talking over some behavior I’ve been seeing with a coworker I’m not so sure. The app is very simple. It’s just a (half baked) b…

---

## [Cannot create new rails app - error while install gem ffi](https://discuss.rubyonrails.org/t/cannot-create-new-rails-app-error-while-install-gem-ffi/79335)

<div class="topic-metadata">

**Author:** [@Deuiro](https://discuss.rubyonrails.org/u/Deuiro)\
**Replies:** 3\
**Last updated:** [January 10, 2022, 5:49am UTC](https://discuss.rubyonrails.org/t/cannot-create-new-rails-app-error-while-install-gem-ffi/79335 "2022-01-10T05:49:59Z")

</div>

When I type ‘rails new myapp’ i get error ''An error occurred while installing ffi (1.15.4), and Bundler cannot continue." my specs: os: Mageia 8 64bit ruby 2.7.2p137 (2020-10-01 revision 5445e04352) \[x86\_64-linux\] Rai…

---

## [Undefined local variable or method \`tagged\_logger' inside Rails 7 ActiveSupport::Testing::Assertions](https://discuss.rubyonrails.org/t/undefined-local-variable-or-method-tagged-logger-inside-rails-7-activesupport-assertions/79541)

<div class="topic-metadata">

**Author:** [@jkwuc89](https://discuss.rubyonrails.org/u/jkwuc89)\
**Replies:** 5\
**Last updated:** [December 21, 2021, 12:09pm UTC](https://discuss.rubyonrails.org/t/undefined-local-variable-or-method-tagged-logger-inside-rails-7-activesupport-assertions/79541 "2021-12-21T12:09:56Z")

</div>

Inside an rspec support module, my app is calling perform\_enqueued\_jobs. The spec in question that is using this support module is expecting this call to raise an exception. When I attempt to run this spec, the followin…

---

## [Rails template task (with LOCATION) raises Errno::ENOENT: No such file or directory @ rb\_sysopen](https://discuss.rubyonrails.org/t/rails-template-task-with-location-raises-errno-no-such-file-or-directory-rb-sysopen/79436)

<div class="topic-metadata">

**Author:** [@viktorianer](https://discuss.rubyonrails.org/u/viktorianer)\
**Replies:** 3\
**Last updated:** [December 6, 2021, 10:09am UTC](https://discuss.rubyonrails.org/t/rails-template-task-with-location-raises-errno-no-such-file-or-directory-rb-sysopen/79436 "2021-12-06T10:09:58Z")

</div>

It looks like it is not a Rails bug, but I am not sure for now. I can not use any template on railsbytes. But my project was created by using ~21 templates 7 months ago. So, it could be a bug in older Rails 6. I love to…

---

## [\[Bug\]\[ActiveSupport\] Digest::UUID namespaced UUID (v3 and v5) generation](https://discuss.rubyonrails.org/t/bug-activesupport-digest-uuid-namespaced-uuid-v3-and-v5-generation/78569)

<div class="topic-metadata">

**Author:** [@erichmachado](https://discuss.rubyonrails.org/u/erichmachado)\
**Replies:** 2\
**Last updated:** [July 30, 2021, 8:57pm UTC](https://discuss.rubyonrails.org/t/bug-activesupport-digest-uuid-namespaced-uuid-v3-and-v5-generation/78569 "2021-07-30T20:57:35Z")

</div>

Hi all, A while ago I’ve opened an issue and proposed a fix to a bug I have faced in the namespaced UUID generation logic that is implemented in the Digest::UUID. I would like to know if there’s interest in having it me…

---

## [Mimemagic/overlay](https://discuss.rubyonrails.org/t/mimemagic-overlay/77483)

<div class="topic-metadata">

**Author:** [@justrudd](https://discuss.rubyonrails.org/u/justrudd)\
**Replies:** 2\
**Last updated:** [March 29, 2021, 7:17am UTC](https://discuss.rubyonrails.org/t/mimemagic-overlay/77483 "2021-03-29T07:17:12Z")

</div>

Updated to 6.0.3.6. After update was done, all Rails commands (db:migrate, console, server, etc.) fail with: cannot load such file -- mimemagic/overlay (LoadError) I was already on 6.0.3.5 so this should have been a re…

---

## [Is this a bug? Records deleted when assigned to belonging association](https://discuss.rubyonrails.org/t/is-this-a-bug-records-deleted-when-assigned-to-belonging-association/77053)

<div class="topic-metadata">

**Author:** [@Delon\_Newman](https://discuss.rubyonrails.org/u/Delon_Newman)\
**Replies:** 2\
**Last updated:** [January 28, 2021, 4:41pm UTC](https://discuss.rubyonrails.org/t/is-this-a-bug-records-deleted-when-assigned-to-belonging-association/77053 "2021-01-28T16:41:05Z")

</div>

Before I post this as a bug in the issue tracker I want to get some other opinions. Is this a bug? class Request \< ApplicationRecord has\_many :items, class: 'RequestItem', dependent: :delete\_all end class RequestItem…

---

## [Problem with activeStorage Blob on upgrade from 6.0.3.4 to 6.1](https://discuss.rubyonrails.org/t/problem-with-activestorage-blob-on-upgrade-from-6-0-3-4-to-6-1/76643)

<div class="topic-metadata">

**Author:** [@michelson](https://discuss.rubyonrails.org/u/michelson)\
**Replies:** 6\
**Last updated:** [January 15, 2021, 1:30pm UTC](https://discuss.rubyonrails.org/t/problem-with-activestorage-blob-on-upgrade-from-6-0-3-4-to-6-1/76643 "2021-01-15T13:30:09Z")

</div>

in the ActiveStorage::Blob class on the initialization we have after\_initialize do self.service\_name ||= self.class.service.name end but the self.service\_name does not exist my guess is that I have miss some mig…

---

## [Rails 5, Require inexistant class fallback](https://discuss.rubyonrails.org/t/rails-5-require-inexistant-class-fallback/76386)

<div class="topic-metadata">

**Author:** [@Mziserman](https://discuss.rubyonrails.org/u/Mziserman)\
**Replies:** 1\
**Last updated:** [October 25, 2020, 10:34am UTC](https://discuss.rubyonrails.org/t/rails-5-require-inexistant-class-fallback/76386 "2020-10-25T10:34:25Z")

</div>

Hello ! I found a behaviour that seems like a bug and couldn’t find discussion about it. In a rails app (with or without bootsnap) with the modules : A::B and A::C::E, in rails console, if I use A::C::B (does not exist)…

---

## [\[ActiveSupport::Cache, ActiveSupport#delegate\_missing\_to\] instance variables "leaking" externally when caching array of ActiveRecord objects with attachments](https://discuss.rubyonrails.org/t/activesupport-cache-activesupport-delegate-missing-to-instance-variables-leaking-externally-when-caching-array-of-activerecord-objects-with-attachments/73632)

<div class="topic-metadata">

**Author:** [@Aaron\_Lipman](https://discuss.rubyonrails.org/u/Aaron_Lipman)\
**Replies:** 0\
**Last updated:** [July 22, 2019, 3:22pm UTC](https://discuss.rubyonrails.org/t/activesupport-cache-activesupport-delegate-missing-to-instance-variables-leaking-externally-when-caching-array-of-activerecord-objects-with-attachments/73632 "2019-07-22T15:22:03Z")

</div>

I’ve found some buggy behavior when caching & uncaching an array of ActiveRecord objects with ActiveStorage attachments. Here’s a truncated code snippet demonstrating the bug: class User \< ActiveRecord::Base has\_one\_at…

---

## [\[ActiveRecord\] Fix this (data loss?) bug in association assignment (has PR)](https://discuss.rubyonrails.org/t/activerecord-fix-this-data-loss-bug-in-association-assignment-has-pr/73356)

<div class="topic-metadata">

**Author:** [@Florian\_Ebeling](https://discuss.rubyonrails.org/u/Florian_Ebeling)\
**Replies:** 0\
**Last updated:** [November 4, 2018, 12:50pm UTC](https://discuss.rubyonrails.org/t/activerecord-fix-this-data-loss-bug-in-association-assignment-has-pr/73356 "2018-11-04T12:50:31Z")

</div>

A while back I discovered a bug in ActiveRecord::Associations::CollectionProxy#replace and fixed it. See links to issue and PR below. I think it can be called a data-loss issue, though it’s unlikely to hit by surprise. …

---

## [forms hidden field CSRF token is not updated when turbolinks is enabled](https://discuss.rubyonrails.org/t/forms-hidden-field-csrf-token-is-not-updated-when-turbolinks-is-enabled/72577)

<div class="topic-metadata">

**Author:** [@Maurizio\_De\_Santis](https://discuss.rubyonrails.org/u/Maurizio_De_Santis)\
**Replies:** 1\
**Last updated:** [June 20, 2017, 3:30pm UTC](https://discuss.rubyonrails.org/t/forms-hidden-field-csrf-token-is-not-updated-when-turbolinks-is-enabled/72577 "2017-06-20T15:30:15Z")

</div>

I’m unsure in which project to open a bug, so I want to ask first. rails 5.1.1, turbolinks 5.0.1, turbolinks-source 5.0.3 Reproduction steps: Visit a page with a form with authenticity token field inside Navigate with…

---

## [Segmentation fault ruby 1.8.7 (2011-06-30 patchlevel 352) \[x86\_64-linux\]](https://discuss.rubyonrails.org/t/segmentation-fault-ruby-1-8-7-2011-06-30-patchlevel-352-x86-64-linux/66404)

<div class="topic-metadata">

**Author:** [@11155](https://discuss.rubyonrails.org/u/11155)\
**Replies:** 2\
**Last updated:** [February 21, 2013, 10:49am UTC](https://discuss.rubyonrails.org/t/segmentation-fault-ruby-1-8-7-2011-06-30-patchlevel-352-x86-64-linux/66404 "2013-02-21T10:49:44Z")

</div>

I am using Active Record outside rails. I created one rb file at: /usr/share/puppet-dashboard/bin/process.rb Code of process.rb #!/usr/bin/ruby require 'active\_record' ActiveRecord::Base.establish\_connection( …

---

## [Segmentation fault](https://discuss.rubyonrails.org/t/segmentation-fault/52483)

<div class="topic-metadata">

**Author:** [@Dani](https://discuss.rubyonrails.org/u/Dani)\
**Replies:** 9\
**Last updated:** [June 26, 2010, 5:25am UTC](https://discuss.rubyonrails.org/t/segmentation-fault/52483 "2010-06-26T05:25:57Z")

</div>

First of all, I use RVM and I installed ruby-1.9.2-head, which I used to create a new rails3 gemset. Then I changed to that gemset with rvm use 1.9.2-head@rails3 and I ran bundle install over the following Gemfile: sour…

---

## [form\_for using wrong dynamic path helper?](https://discuss.rubyonrails.org/t/form-for-using-wrong-dynamic-path-helper/51858)

<div class="topic-metadata">

**Author:** [@Jury](https://discuss.rubyonrails.org/u/Jury)\
**Replies:** 10\
**Last updated:** [May 24, 2010, 12:53am UTC](https://discuss.rubyonrails.org/t/form-for-using-wrong-dynamic-path-helper/51858 "2010-05-24T00:53:50Z")

</div>

Hi guys, I've come across what I think is a bug in form\_for in Rails 3 beta 3, and just wanted to run it by you before I needlessly created a ticket. Here's the situation: Named route: resources :thread, :class\_name…

---

## [AS::MB::Chars concatenation with + (plus) 	method should not alter the original](https://discuss.rubyonrails.org/t/as-chars-concatenation-with-plus-method-should-not-alter-the-original/51736)

<div class="topic-metadata">

**Author:** [@James\_MacAulay](https://discuss.rubyonrails.org/u/James_MacAulay)\
**Replies:** 3\
**Last updated:** [May 20, 2010, 3:45am UTC](https://discuss.rubyonrails.org/t/as-chars-concatenation-with-plus-method-should-not-alter-the-original/51736 "2010-05-20T03:45:43Z")

</div>

Small but nasty bug, tested and fixed: https://rails.lighthouseapp.com/projects/8994-ruby-on-rails/tickets/4646-bug-activesupportmultibytechars-concatenation-with-plus-method-should-not-alter-the-original Would love so…

---

## [sqlserver\_adapter](https://discuss.rubyonrails.org/t/sqlserver-adapter/46295)

<div class="topic-metadata">

**Author:** [@Rob\_Nichols](https://discuss.rubyonrails.org/u/Rob_Nichols)\
**Replies:** 2\
**Last updated:** [September 23, 2009, 3:00pm UTC](https://discuss.rubyonrails.org/t/sqlserver-adapter/46295 "2009-09-23T15:00:06Z")

</div>

There is a bug in the activerecord-sqlserver-adapter-2.2.21 gem. The error is in: activerecord-sqlserver-adapter-2.2.21\\lib\\active\_record \\connection\_adapters\\sqlserver\_adapter.rd And is at line 1058. FROM #{db\_name}I…

[Next page](https://discuss.rubyonrails.org/tag/bug/5.md?match_all_tags=true&page=1&tags%5B%5D=bug)
