229,119 questions
Score of 1
1 answer
76 views
Ruby native extensions fail to build after macOS upgrade
After upgrading to macOS Golden Gate 27.0.1, my Jekyll-based website stopped working because Bundler cannot find several required gems.
Ruby and Bundler versions
ruby 4.0.9 (2026-10-23 revision ...
Score of -1
1 answer
538 views
Text preprocessing packages in addition to Mustache that are importable both into Python code and Ruby code
I'm running the latest versions of Python and Ruby under Debian Linux version 13.
I make use of text preprocessing both in Python and Ruby, and this is only used for preprocessing text in files that ...
Score of 0
1 answer
111 views
How to test rate limit in Rails?
How can I test with RSpec I'm using rate_limit method on my Rails 8 app?
class SessionsController < ApplicationController
rate_limit to: 10, within: 3.minutes, only: :create
end
Score of -3
1 answer
79 views
Ruby 3.3, method that takes **options as an argument errors when passed an empty hash [duplicate]
I am calling a method that takes an argument and also uses `**options` to convert remaining key-pair values into a hash. Here's a simpler example method that does the same thing.
def foo(arg1, **...
Score of 1
2 answers
89 views
Ruby on Rails SQLException: no such table: main.tos: (ActiveRecord::StatementInvalid)
I am new to Rails and I'm trying to create a many-to-many connections between a Station model with a Connections table.
I ran
bin/rails g model Station name:string
bin/rails g model Connection from:...
Score of 0
1 answer
83 views
Rails 8 has_many attachments not saving to db
I have this code in a form
<%= form.label :image, style: "display: block" %>
<%= form.file_field :images, multiple: true %>
and this in the controller
before_action :...
Score of 0
0 answers
83 views
Can't verify CSRF token authenticity in Electron desktop app
I recently migrated my web application into a desktop application with Electron. I am using Rails 8 to load Vite which loads my frontend with React and TypeScript.
Everything was working well until I ...
Score of 3
2 answers
109 views
Docling Serv API not returning multiple result formats when queried with a HTTP library from Ruby
I observe a strange effect using the Docling Serve API.
I'm running Docling as Docker container on macos with Docker Desktop. Depending on the method I use to query the server (with curl and a script ...
Score of 0
1 answer
102 views
How to make a guest connection in Action Cable?
I read Rails guide about Action Cable. It explains how to make an Action Cable connection authorised by a user.
However, I wonder how to make a guest Action Cable connection. Rails guides don't ...
Score of 3
1 answer
164 views
How to make sentence DSL in Ruby?
A couple of years ago, I saw a video on youtube where a person writes an example of Ruby DSL, but with the syntax of a regular sentence, without any commas or other separators, something like this:
...
Score of 1
1 answer
155 views
Advance inner and outer loop at the same time, but stay inside inner loop until condition is met
In Ruby, I have an array of arrays containing states and cities like so:
[ ['Alaska', 'Anchorage'], ['Alaska', 'Juneau'], ['Ohio', 'Akron'], ['Ohio', 'Cleveland'], ['Washington', 'Seattle'], ['...
Score of 0
1 answer
114 views
User unexpectedly being logged out in test using Timecop after adding `expire_after` to session store
I have an RSpec system test like this:
before do
do_login
end
after do
Timecop.return
end
it 'does something' do
Timecop.freeze(Time.current.noon)
visit '/staff'
expect(page).to ...
Score of 3
1 answer
129 views
Gem::Version : Getting Argument Error, although I am passing the correct number of parameters
I have the code
class EmptyVersion < Gem::Version
def initialize
super('')
end
end
v = EmptyVersion.new
Running this produces:
'new': wrong number of arguments (given 0, expected 1) ...
Score of 1
3 answers
267 views
Count the number of vowels in a text
A rookie in Ruby here. I'm trying to count the number of each vowel in a text entered by the user but I'm stuck. My code is this at the moment:
def count_vowels(phrase)
puts 'Enter a text:'
...
Score of 0
2 answers
100 views
A rubylang mode for the Jed editor (from jedsoft)?
I'm running the latest Jed editor from jedsoft.org under Debian 13 and under LinuxMint 22.3.
I want to create a mode in Jed for editing code in the Ruby language.
Before I try to "re-invent the ...