229,125 questions
Score of 2
2 answers
50 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 -1
0 answers
95 views
What to put for Redirect URI for a Ruby program using the rspotify gem that just runs on my home laptop?
I'm writing a Ruby program that pulls down Spotify playlists from my Spotify account and displays them visually in a static HTML page that I then convert to PDF.
I'm using the rspotify gem (2.12.4). ...
Score of 0
1 answer
72 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 2
1 answer
128 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
135 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
99 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 2
1 answer
118 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
250 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
88 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 ...
Score of 1
1 answer
119 views
How to parse and generate week strings for HTML week elements in Ruby/Rails? [closed]
HTML has a week selector <input type="week"> which provides a string such as 2026-W05 (Week 5 of 2026).
Ruby provides the strptime/strftime methods which seem to be able to handle this ...
Score of 0
2 answers
219 views
How to minimize number of lookups in a Hash?
say you want to find the first duplicate in an array. you could do something like this:
cnt = {};
[ 11, 22, 77, 22, 33 ].each_with_index { |x,i|
j = cnt[x]; ## <1>
break [x, j, i] ...
Score of 1
0 answers
65 views
Hanami db migrate
I'm following the Hanami tutorial documentation for building a web app.
I run bin/hanami db migrate and I get the following error:
=> database db/bookshelf.sqlite migrated in 0.2763s
Error: in ...
Score of 1
1 answer
81 views
msgpack gem failing to install on MacOS when running `bundle install`
I'm on MacOS Tahoe (26.3.1 (a)). I have a Ruby project which requires msgpack (1.4.2).
Unfortunately, when I run bundle install, I see:
Fetching msgpack 1.4.2
Installing msgpack 1.4.2 with native ...
Score of 1
1 answer
78 views
How to use existing chromium profile for ferrum?
I have setup chromium profile and wish to use that with ruby ferrum library. I copied complete configurations directory into /tmp and passed browser switched, but profile extensions seems to not work....
Score of 0
1 answer
139 views
Automating repetitive tasks with Ruby and Selenium WebDriver
I followed the advice from this question and I started to experimenting with Selenium, but I feel like it has to many limitations. Could you recommend something more suitable?
A simple program that ...