rom-sql: Sequel 5 RuntimeError
This commit in Sequel version 5 changes Sequel::SQL::Expression.to_s_method by freezing @comparison_attrs and causing a RuntimeError with the message “can’t modify frozen Array” when using the master branch.
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Comments: 17 (8 by maintainers)
In my case this issue happened because
sequel/sqlwas loaded twicesequel/corerom/sql/types:When
sequel/sqlis loaded the second time, something like this happens:Sequel::SQL::Expression.attr_reader([].freeze)->[].freeze.concat [:comparison_attrs]-> RuntimeError: can’t modify frozen ArrayThe reason why
sequel/sqlis loaded twice is becauserequireandrequire_relativebehave differently:require_relativeuses real path without symlinks andrequiredoes not. If you install rbenv or asdf via Homebrew then everything is stored in/usr/local/Cellar/x/1.2.3and symlinked to/usr/local/opt/x, which explains this issue.This bug has been fixed in Ruby recently, please see https://bugs.ruby-lang.org/issues/10222
@flash-gordon and @solnic, I am glad to say I have managed to narrow the runtime error down to Rbenv version 1.1.0. I haven’t worked out what was causing it, but it is fixed in the latest release v1.1.1.