Integrating Bluetooth Device Scanning in a Ruby on Rails Application [closed]
I'm developing a web application using Ruby on Rails , where the frontend is react and backend is Rails.The goal is to integrate Bluetooth device scanning functionality similar to native mobile apps.Is...
View ArticleHow to use .any method in an if statement in Ruby and capture the variable...
I am evaluating for the software I am working on a simple scripting language. I've mapped out what I need for Python but I'm just trying Ruby since it was recommended to me as a simple language. Some...
View ArticleBegin, Rescue and Ensure in Ruby?
I was wondering if ensure was the Ruby equivalent of finally in C#? Should I have:file = File.open("myFile.txt", "w")begin file << "#{content} \n"rescue # handle the error hereensure file.close...
View ArticleImplement Searchkick with search_after and PIT (Point In TIme)
first of all, I have code like thisoptions = {order: {name: :asc}, per_page: 100, page: current_page}products = Product.search("*", **options)and encountered this error in ElasticSearch pagination...
View ArticleGetoptLong is not raising error when GetoptLong::REQUIRED_ARGUMENT is not...
First of all in my tests the errors are only triggered when calling .each, not in the constructor so this:require "getoptlong"GetoptLong.new( [ "--argument", "-a", GetoptLong::REQUIRED_ARGUMENT ])# ~$...
View Articlesaved_changes is empty after persisting changes on a Rails model
We have a Rails 6.1 application running an after_commit callback to look into saved_changes value to run some background workers. But the issue is saved_changes returns empty if a model has...
View Articlebuilding ruby 3.3.0 rpm on amazonlinux2023 is linking to hard coded directories
I've been using the below ruby.spec to build RPMs on amazonlinux:2 for several versions of ruby now. Works great.I'm working on migrating to amazonlinux:2023 and while this still produces an RPM, when...
View ArticleHow do I populate intl-tel-input fields with turbo_stream?
I already have the number saved in my database, using a turbo_stream file and using the turbo_power library I need to change the empty value to the number I have in my database (example:...
View ArticleAccessing protected route with devise returns 401
I'm making an API using Ruby on Rails with Devise for authentication. I have setup my login/signup functions and receive access and refresh tokens. However, when I go to access a protected route like...
View Articleruby 2.0 rails gem install error "cannot load such file -- openssl"
I am using osx 10.8.2 installed ruby 2.0 and.... got this when trying to run "sudo gem install rails"$ sudo gem install railsERROR: Loading command: install (LoadError) cannot load such file --...
View Articleactive admin gem error message just following the instructions
I am using ruby 3.1.3, rails 7.0.5 and activeadmin 3.0.I just followed the installation instructions from the activeadmin website, but I got the following error:ActionView::Template::Error (Ransack...
View Articleruby function adding pkg exclusion if not already exists in each repo defined...
I am trying to create ruby function (within chef cookbook) adding package exclusion string to each repo defined in /etc/yum.repos.d/repo.repo.In example, for pkg zabbix* it search each repo and add...
View ArticleHow to "recompile Ruby with OpenSSL support" using RVM?
After installing Ruby 2.3.8 via RVM I get the following error when running bundle:You must recompile Ruby with OpenSSL support or change the sources in your GemfileHow do I recompile Ruby with OpenSSL...
View ArticleSSL verification error at depth 0: unable to get local issuer certificate (20)
My company uses a proxy for all internet traffic for security reasons, but unfortunately this breaks SSL with Ruby.When I try gem install rake or any other gem command, I get the following error:ERROR:...
View ArticleHow do I set date time to 1 month ago with DateTime.now.strftime("%Y-%m-%d")?
I am trying to use set Google Analytics start date and end date to capture unique visitors within the last 30 days. I have made end_date = DateTime.now.strftime("%Y-%m-%d"), how do I set start_date to...
View ArticleHow to add a data-attribute to each option of my select box?
In my Rails app I have this select box:<%= f.select :invoice_id, current_user.invoices.numbers_ordered %>This is my Invoice class:class Invoice < ActiveRecord::Base belongs_to :user def...
View ArticleMac os: Rails broken - bundle not working - ovirt-engine-sdk - ERROR: Failed...
I'm trying to use ovirt-engine-sdk gem in my rails(6) application. bundle install is failing in my mac machine.As per the PR's the gem should work with ruby 3.x versions but i'm getting following error...
View ArticleHow do you increase the starting memory and allocation rate of a Ruby process?
I am running an MRI Ruby 3.3.3 script that starts by creating an array of several million unique items. (I doing some data stream processing). The process starts with ~350 MB, and then starts to grow...
View ArticleWhy is my brand new MacBook Pro so slow(took hours) running `make` for ruby...
Screenshot of the terminal + activity monitor + About my MacThe MacBook pro 14 inches is brand new out of the box, from Nov 2023.16 GB Ram. M3 processor.I opened iTerm, installed brew, installed asdf,...
View ArticleWhy is this an error with ERB?
<div class='row'><%= form.field_container :name do %><%= form.label :name, raw('Name'+ content_tag(:span, ' *', :class => 'required')) %><%= form.text_field :name, :class =>...
View Article