229,238 questions
0
votes
0
answers
42
views
Ruby Nokogiri Sax parser does not unescape & attribute
With the following code:
require 'nokogiri'
class MyDocument < Nokogiri::XML::SAX::Document
def start_element_namespace(name, attrs = [], prefix = nil, uri = nil, ns = [])
a = attrs.map ...
3
votes
0
answers
56
views
Heroku ruby buildpack breaks on second deployment push
I've upgraded Ruby from Ruby 3.1.7 to Ruby 3.2.8; after that, I've encountered a situation where my ruby bundle works for the first deployment on Heroku-deployed servers, but all subsequent ...
1
vote
1
answer
85
views
Negative Unix timestamp in Ruby
I have the following Unix timestamp:
time = Time.at(-8_640_000_000_000) # => -271821-04-19 19:00:00 -0500
time.strftime('%B %-d, %Y at %-I:%M %p') # => "April 19, -271821 at 7:00 PM"
...
Advice
0
votes
5
replies
48
views
Why are things magically available in the current scope in a ruby script in Jekyll?
My question could apply to many other ruby frameworks I guess. But here I have the case while programming a Jekyll project.
Let's see this Jekyll plugin as an example:
require 'dotenv'
module Jekyll
...
-3
votes
0
answers
46
views
How to convert a unicode value to a utf-8 character in Ruby 1.8.7 [duplicate]
I'm looking at the characters in this pdf:
https://www.unicode.org/charts/PDF/U1D100.pdf
For example, the treble clef symbol which has a unicode value of '1D120'
In ruby 1.8.7, how would i convert ...
-4
votes
1
answer
109
views
chruby - kernel_require.rb cannot load such file -- uby-4.0.1 [closed]
I have a git post-commit hook written in Ruby.
#!/usr/bin/env ruby
require "git"
# ...
It works perfectly fine from the console.
However, when it's run from IntelliJ IDEA I see:
2026-02-18 ...
-3
votes
0
answers
102
views
How to capitalize captured groups in ruby?
text = "hello world"
text.sub(/(hello)\s(world)/) { "#{$2.capitalize} #{$1.capitalize}" }
This is the only way I know how to do this.
text.sub(/(hello)\s(world)/, '\u\2 \u\1')
...
0
votes
1
answer
179
views
Italian locale settings break Excel Formulas in my code
I wrote a small Excel COM automation code that works on my machine.
Since everything worked fine, I have decided to test it on a client machine. Only formulas didn't work.
I always get #NOME? for ...
1
vote
1
answer
87
views
Embedding data in non-Rails Sprockets SCSS
I have a non-Rails Ruby application that uses Sprockets and Sinatra. It currently processes SCSS using the sass and sprockets-sass gems, which have long been deprecated in favor of processing by dart-...
1
vote
2
answers
101
views
UnknownAttribute exception when trying to clone Mongo document objects in a Rails app
I'm working on a Rails application containing several models based on Mongo documents.
I'm eventually bumping into an Mongoid::Errors::UnknownAttribute exception when mongoid Copyable#clone method is ...
Advice
0
votes
2
replies
72
views
Why does Rack::Protection allow external clients without whitelisting, but rejects the same backend server's domain?
I'm building an MCP server using Sinatra with Fast-mcp (HTTP-based Rack middleware). I'm encountering confusing behavior with Rack::Protection that doesn't align with what I understand from reading ...
1
vote
1
answer
132
views
Rails ViewComponent tabs not rendering content
Rails ViewComponent tabs not rendering content - active tab issue
I'm building a tabs component using ViewComponent and Stimulus, but the tab content (partials) are not rendering. I believe it's ...
0
votes
1
answer
103
views
"Content missing" Ruby on Rails, Turbo issue
I have turbo rails built into my ruby on rails application, I have a section of the screen I am trying to reload with a button click. more specifically a directory tree. But every time I click said ...
2
votes
1
answer
115
views
Homebrew: formula fails to run with error ZIP does not support timestamps before 1980
I maintain a Homebrew formula on my own tap, and I'm having issues to update it. I'm not sure if this is Python- or Homebrew-related. Here is my formula:
class Kosmorro < Formula
include Language:...
0
votes
1
answer
115
views
Unable to run single test with Rails/Minitest
We have two almost identically set up Rails (v8.1.1) applications, both with Minitest (v5.27.0) as the testing framework. But in Application A we can run single tests from a file, but not in ...