229,243 questions
-4
votes
0
answers
71
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
137
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
72
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
92
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
66
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
128
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
100
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
107
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
112
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 ...
1
vote
1
answer
347
views
"rails test" doesn't run any tests
I downloaded Ruby and Rails onto my machine, and it looks like this:
% which ruby
/Users/jgodse/.rbenv/shims/ruby
% ruby --version
ruby 3.4.8 (2025-12-17 revision 995b59f666) +PRISM [arm64-...
2
votes
1
answer
134
views
Ruby irb: Autocomplete-usage leads to crash
I start typing on the console and a list with the feasible options appears. Then I use the tabulator-key for going through the options.
Immediately irb crashed and exits. I'm on the console again.
...
0
votes
1
answer
61
views
How to get Details on Discount from a Subscription in Stripe?
There is no API for querying discount information directly. When querying the subscription:
Stripe::Subscription.retrieve('my_sub_id')
# returns:
#<Stripe::Subscription:0xb8a80 JSON: {
..
"...
0
votes
1
answer
47
views
With the Pay gem using stripe, how do you subscribe to a subscription applying a discount?
Consider the following:
@user.payment_processor.subscribe(name: "default", plan: "monthly", quantity: 3)
How do you subscribe with a coupon code attached?
See: https://docs.stripe....
0
votes
0
answers
234
views
gem 'ruby-vips' on Windows: non-compatible forward slashes in the vips-module path
After upgrading Rails from 8.0 to 8.1 and running rails s on Windows, I get VIPS warnings, for example:
unable to load "C:\Ruby34-x64\msys64\ucrt64/lib/vips-modules-8.17\vips-heif.dll"
...
0
votes
2
answers
86
views
Message body is blank when retrieving emails with Ruby GMail API
I have some code which calls Google's Ruby API to get messages from GMail using list_user_messages.
I know from docs that the returned messages only contain an id and thread_id and therefore I have ...