Positive lookahead doesn't stop at first occurrence
I use the regex (?<=Charset:\s).+(?=<br\/>) on the following data (There is no newline char in the data, I made it look better) to capture the Charset string<div...
View ArticleRails 7 ActionText / rich_text null error
I'm trying to build a really simple backend only rails app with a post class. I can't seem to get my 'Posts' to persist because the rich_text field doesn't seem to be working. My actually class has...
View ArticlePass two ids in a table with checkboxes
I have been struggling with creating the Roles in my application, I have installed the gem Rolify and it created a model Role in which this is the code: class Role < ActiveRecord::Base...
View ArticleRandom ActiveRecord::StatementInvalid errors on Rails 4 app on Heroku
My Rails 4 app works fine locally, and also when it's deployed to Heroku in production mode... until I access the app from a second client... then after a few clicks I start getting the following...
View Articleruby / rails find value from initial range
What is the best way to find the key of a hash based the value of a key and the next key value?Easier to understand with an example:Considering this code:h = {'size-1': 0,'size-2': 50,'size-3':...
View ArticleHow to run paths in specific file or run only specific path to test swagger...
I have a project in which many API calls are defined with rswag to generate the open API documentation.In this project, I categorized my endpoint paths in separate ruby files.My question is, When I am...
View ArticleRuby ffi Gem Installation Fails on Windows Even After Installing Ruby with...
Following this post I encountered an issue while running bundle update --bundler. The process failed due to an error with the ffi gem installation.Fetching gem metadata from...
View ArticleError with Bundler Commands in Specific Directory on Windows: NoMethodError...
I've encountered an issue while trying to install ltx2any by following the instructions provided on its GitHub page. I am not very familiar with Ruby, and I installed it using Chocolatey on Windows. I...
View ArticleCan't install RMagick 2.16.0. Can't find MagickWand.h Mac OS Sonoma
I'm using Mac OS Sonoma 14.2.1ruby 2.6.5imagemagick@6: stable 6.9.13-4I'm trying to dogem install rmagick -v 2.16.0 catching itBuilding native extensions. This could take a while...ERROR: Error...
View ArticleHow to use csv converter encoding in ruby?
require 'csv'module Expertus class Dataset < Array attr_accessor :data_type, :udc_id, :filename_suffix# knows its common_udc_id and data type def initialize *args CSV::Converters[:non_octal_integer]...
View Articleundefined method `name_cont' for Ransack::Search
I was trying to use the ransank gem. But for some reason I getundefined method `name_cont' for Ransack::Search>:Ransack::Searchusers_controller.rbdef index @q = User.ransack(params[:q]) @users =...
View ArticleExternal API or a Package or a Library, To format most of the common...
I need an external API or a Package or a Library, To format most of the common programming languages. (except prettier)Suggest me an external API or a Package or a Library, To format most of the common...
View Article"TypeError: no implicit conversion of Hash into String" in specs after update...
All specs fails with error no implicit conversion of Hash into String after update to Rails >7.1.0Example: TypeError: no implicit conversion of Hash into String #...
View ArticleHow to solve "Double free for ptr 0x7f7c33808200" in ruby on rails?
I have a Ruby on Rails API application on macOS Sonoma, x86 intel i7.I can start the server using rails s. When I hit my endpoint, it logs the following:Started POST "/v1/login" for ::1 at 2023-12-13...
View ArticleParse comma separated values
I would like to parse comma separated values from a url parameter in Ruby on Rails.For example how to parse the following?http://example.com/?fields=1,2,3I would like to be able to use params[:fields]...
View ArticleRails 7 - How to run a before action with inline code only for an action
In Rails 7.1 with Ruby 3.2.2, what's the correct syntax to run a before_action filter with inline code only for a specific action?I have tried everything suggested in Before action with inline method,...
View Articleruby on rails soft deleting is not working properly and it is included in...
I am begginer wirh ruby on rails and start working on an already designed webapp build with ruby on rails (ruby v3.0.4 and rails v7.0.4).Recently I noticed that soft deleted records are now displayed...
View ArticleTrouble Installing Specific Version of Ruby (OpenSSL Issue)
I have a 2020 Intel Mac running Sonoma. I'm working on a web app project that is running on Rails. For the last few months, I've had the same issue no matter what I try. I follow the Rails instructions...
View ArticleHow to encrypt existing data with Ruby on Rails?
I want to encrypt some fields of some tables from my db. If I add encrypts :'field_name' to model class, it won't encrypt data already added to db. I guess I have to write a migration that will do...
View ArticleAsset compiling crashing on server environment with: "NoMethodError:...
I've been pulling my hair out for this one. I've always had a bad relationship with the asset-pipeline, it is always giving me trouble.. And today again..When I try and compile my assets locally,...
View Article