How to compile ruby in debug mode?
There are plenty of ruby debug log calls in the source code that help me better understand internals.How do you debug ruby vm? Do you have a documentation for that?I haven't found any information in...
View ArticleEmacs M-x eglot unable to connect to solargraph
I figured I'd join the modern dev world and check out Eglot for the first time in Emacs 29.3. When I enter M-x eglot on a Ruby file, I receive the error:eglot--error: [eglot] `solargraph' not found in...
View ArticleCSV.foreach Not Reading First Column in CSV File
Learning Ruby for the first time to automate cleaning up some CSV files. I've managed to piece together the script below from other SO questions but for some reason the script does not read the first...
View ArticleIs there a way to remove the BOM from a UTF-8 encoded file?
Is there a way to remove the BOM from a UTF-8 encoded file?I know that all of my JSON files are encoded in UTF-8, but the data entry person who edited the JSON files saved it as UTF-8 with the BOM.When...
View ArticleInstalling Jekyll on my M3 Macbook won't "stick"
I think I have painted myself into a corner trying to override the default Ruby install so that I can install Jekyll.Here is a rough timeline:I follow this tutorial to the letter and it works, my site...
View Articlebundler: failed to load command: rspec
I am new to Rails and I want to run Rspec using Mac.When I run: bundle exec rspec spec/00_hello_spec.rb I get the following response:bundler: failed to load command: rspec...
View ArticleWeb Scraping with Nokogiri::HTML and Ruby - save images
I'm working on a script to grab data & images from webshop productpages (with approval from the owner)I have a working script that loops through a CSV file with 20042 product URLS to get me the...
View ArticleWeb Scraping with Nokogiri::HTML and Ruby - Output to CSV issue
I have a script that scrapes HTML article pages of a webshop. I'm testing with a set of 22 pages of which 5 article pages have a product description and the others don't. This code puts the right info...
View ArticleWeb Scraping with Nokogiri::HTML and Ruby - How to get output into an array?
I've just started with nokogiri to scrape info from a site and can't figure out how to get the following done. I have some HTML code I want to scrape:<div class="compatible_vehicles"><div...
View ArticleUnable to install debase gem
I am trying to debug code in Rubymine. It looks like we need to install debase first. I tried to search in google but could not find any solution.$ ruby -vruby 3.0.0p0 (2020-12-25 revision 95aff21468)...
View ArticleRuby - Creating a file in memory
Is there anyway to write the following code in Ruby without writing the file to disk?temp_file = 'path/to/file.csv'users = [a@b.c, c@b.a]CSV.open(temp_file, "w") do |csv| csv <<...
View ArticleZeitwerk? Ruby on Rails ::Domains::Article => /app/domains/domains/ariticle.rb
I have domain logic code stored inapp/domains/domains/article.rbThe class isclass Domains::ArticleendIt bothers me that the proper loading structure is app/domains/domains/article.rb and not...
View ArticleRuby on Rails: how to efficiently save nested attributes (recursively)?
I'm using Rails 6.1.3.2 and trying to make saving of nested attributes more efficient. The database used is MySQL.Code basisBoardSet.rbclass BoardSet < ApplicationRecord has_many :boards,...
View ArticleRuby (3.3.4) and Rails (7.1) - rails s Zeitwerk - uninitialized constant...
I am trying to update my ruby app from ruby 2.6.6 to ruby 3.3.4 and Rail 5.1 to Rails 7.1I know it is not a good practice to do so, but in my case (which is a bit complicated) I felt I didn't have much...
View ArticleNative file open dialog in Windows Ruby
As far as I understand, there are no gems which help to open native file dialogs, so I am interested in writing one, specifically for WindowsI'm stuck at the first step which is getting the CLSID for...
View ArticleImplement prometheus and garafana for a ruby on rails application
I am looking for a help to implement prometheus and garafana in my rails app. I have tried using prometheus-client and yabeda-prometheus gem. I have also tried with prometheus-exporter gem but all in...
View Articlexapian-full-1.2.3 not able to install succesffully
Application not starting after ubutu patch upgrade./home/azureuser/app2/currentfatal: not a git repository (or any of the parent directories): .gitfatal: not a git repository (or any of the parent...
View ArticleHow to filter parameters in rails?
Rails has built in log filtering so you don't log passwords and credit cards. Works great for that but when you want to trigger a custom log (like to email) and send your own params or other data along...
View Articlefaraday timeout on a simple get
Is there a way to add timeout options in this simple get method?I am using Faraday 3.3.Faraday.get(url)After searching around, I can only apply timeout options after I initiate a connection first, then...
View ArticleInjecting dynamic values for a specific schema to validate against
I have the following yaml file that I would like to validate using dry-rb.---environment: # required test: # should be dynamic service_credentials: "test_credentials" # required stage:...
View Article