Questions tagged [ruby]
Ruby is a multi-platform open-source, dynamic object-oriented interpreted language. The [ruby] tag is for questions related to the Ruby language, including its syntax and its libraries. Ruby on Rails questions should be tagged with [ruby-on-rails].
ruby
229,197
questions
0
votes
1
answer
47
views
Rails: Extended class that calls another extended class
Setup:
We got an initializer (in config/initializers) that requires a file where we define our extensions.
This file does something like this:
module UbiquoExtensions
end
:SomeClass.include!(...
0
votes
1
answer
75
views
bundle install cannot load such file
When I try bundle install or RCT_NEW_ARCH_ENABLED=1 bundle exec pod install in my project I get this error. Mac on chip M2
/opt/homebrew/opt/ruby/bin/bundle:25:in `load': cannot load such file -- /opt/...
2
votes
1
answer
64
views
Ruby setter-methods: Is the equal-character (=) a convention or functionality?
Taken this class as a example:
class House
def initialize(color, size)
@color = color
@size = size
end
def color
@color
end
# Is the = part of the syntax or a convention?
def ...
0
votes
0
answers
29
views
Trying to install Nanoc (with Ruby) on Fedora Linux, but getting an error I can't decipher
I try to install Nanoc on Fedora Linux.
I've successfully installed Ruby using
dnf install ruby
Checked it with ruby -v and made sure rubygems is installed. Also checked version to verify ...
0
votes
0
answers
18
views
Issue with rails hotwire trix textarea resize
im trying to create a textarea resize grippie more or less like the SO for a trix textarea with rais stimulus so i set this controller below
the issue is when i pull down the textarea the textarea ...
0
votes
1
answer
34
views
Ruby with Postgresql raising NumericValueOutOfRange
I'm trying to do the following query using ruby and pqsql, but when trying a range with more than 1.000 registers I'm receiving an error.
.
.
.
user.left_outer_joins(:coverage_radius).where(id: i)....
0
votes
2
answers
80
views
Model VS Active record in ROR
Can somebody please explain me the difference between model and active record in simple words ?
Is active model and model same ?
PS: Knowledge regarding these topics will be appreciated.
I am newbie ...
0
votes
1
answer
37
views
Why can't I wrap Sidekiq.configure_server in Rails after_initialize?
After upgrade to Rails 6 the initializers/sidekiq.rb is causing deprecation warnings about class autoloading. As a workaround I thought I could wrap the contents of Sidekiq.configure_server in Rails....
5
votes
5
answers
135
views
Capturing all matches of a string value from an array of regex patterns, while prioritizing closest matches
Let's say I have an array of names, along with a regex union of them:
match_array = [/Dan/i, /Danny/i, /Daniel/i]
match_values = Regexp.union(match_array)
I'm using a regex union because the actual ...
0
votes
1
answer
55
views
Rails: problem with "@hotwired/turbo-rails" and redirects
// app/javascript/application.js
import "@hotwired/turbo-rails"
import "controllers"
import "trix"
import "@rails/actiontext"
import Rails from "@rails/ujs&...
0
votes
0
answers
34
views
Ruby debugging will not work in VSCode for any of the debuggers
I am trying to debug a ruby program and cant get the debugger to work for ANY of the debuggers. I have tried rdbg, pry-byebug, byebug and LSP. Every time I try to run the bebugger it says DEBUGGER : ...
0
votes
1
answer
45
views
Both controller level and Model level metadata simultaneously in the same column of record. how to store in PaperTrail: versions table
I'm encountering an issue with PaperTrail in my Rails application where I'm trying to store both controller-level and model-level metadata in the versions table, but only the controller-level metadata ...
0
votes
0
answers
28
views
unknow keyword: :expires_in when deploy Ruby 3.2.2 application to AWS Elastic Beanstalk
When I try to deploy Ruby 3.2.2 application to AWS Elastic Beanstalk (Platform Ruby 3.2 running on 64bit Amazon Linux 2023), I get below error:
[29074] unknown keyword: :expires_in
[29074] /var/app/...
0
votes
1
answer
52
views
How do I remember where user left in rails
In rails how do I remember which page user left at with user login.
When same user comes back he lands on the same page.
I am new to rails not sure how I can approach this problem.
Is there any gem to ...
1
vote
0
answers
33
views
Why Tailwind CSS doesn't works with public/*.html files in my Ruby on Rails project
I'm using Tailwind CSS for my Ruby on Rails project, the CSS works fine with all the layouts in views but it doesn't works with public/*.html files in my project.
I have a 404.html page and a 500.html ...