Category "ruby"

Call Private methods outside class definition

I'm trying to use a Gem that provides me with a DSL i need to apply on some of my classes. But using it directly makes my class definitions not as clean as i wa

rails server not running exiting

This is the output I have obtained when run rails server. I am new to ROR and the version is 3.1.0. Any help would be appreciated I am running this in windows 1

Force Jekyll to re-read files in a collection to _site after a Hook runs

I've written a Hook for my Jekyll site that takes a .json file from my _data directory, creates a bunch of .md files from it's content and stores them in a _col

Breakpoint not working on VScode for Rspec Rails

Not sure what's wrong with my setup. I've been stuck on this issue for a day now and still hasn't resolved this. I've setup my VScode so I can debug my specs (f

libffi.so.8: cannot open shared object file

I upgraded Rails to 7.0.1. When I do the rails g controller Pages home, it's giving the error: >>rails g controller Pages home /home/shadman/.rbenv/versio

How to use Unicode chars with Nokogiri::XML::DocumentFragment

I want to use Unicode char with Nokogiri::XML::DocumentFragment. frag = Nokogiri::XML::DocumentFragment.parse("<foo>ü</foo>") => <foo>

How to remove an element from a json with ruby?

For this json structs: { "a_path": { "b_path": [ { "id": 1, "name": "a" }, { "id": 2, "name": "b"

Every error in the book from google-api-ruby-client but no data

I have been attempting to work on a request from my boss this week that requires using the google admin directory api. At this point I am questioning if what I

What is the return value of update_all() in ActiveRecord / Ruby on Rails?

The Ruby on Rails and ActiveRecord documentation, Google, and StackOverflow are conspiratorially silent on the return value of update_all() What does update_al

Uninitialized constant User::ChatRoom

I get this error NameError (uninitialized constant User::ChatRoom): app/controllers/users_controller.rb:20:in `create' Here is my user.rb file class User in

Only execute code in erb if variable exists?

Ruby newbie here who just started using Ruby with .erb templates and I'm having a problem with the code. I have a hangman game that's passing variables from the

Unable to install sqlite3 gem

I have an issue trying to install the sqlite3 gem using Ruby on Rails 3.0.1. Using Windows 10 21H2 x64. The SQLite engine is installed. Below is the error messa

How to debug Ruby code on Visual Studio Code?

I am new to VSCode, however, I did download the required extensions as I read in a website. So far, I can't debug Ruby on VSCode, and I am not sure where the pr

NoMeasureSelected CampaignPerformanceReportRequest Microsoft Ads

I'm trying to setup Microsoft ads to a project and get CampaignPerformanceReportRequest working on my project but I'm receiving NoMeasureSelected error. Not sur

Ruby 3 - Save without validation no longer works on one table

I am upgrading an application from Ruby 2.6.10 to Ruby 3.0.4 and have a very odd situation. When I execute the command record.save(validate: false) on one of m

Ruby - Appium (android) webdriver actions throws "NoMethodError: undefined method `perform_actions' for nil:NilClass"

I saw that touch actions are now deprecated and the recommendation is to use webdriver actions instead. I've been following the exact example from: https://appi

Arel - How to coalesce a field and a string literal in an Arel query?

I inherited a big, complicated Arel query that pulled from a number of tables. A new requirement says that if one of those tabels doesn't have a value for a par

multipart SOAP request in Savon

I need to build this multipart request in SAVON for calling executeProcess method of a SOAP service: <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoa

Unable to search on whole database with searchkick as it limits to 10000 records

Unable to search on whole elastic search DB just by using SearchData.search('yamaha', match: :word_middle,load: false) This limits the search to 10000 records

Rails SQL "select in" across several columns: where (code1, code2) in (("A", 1), ("A", 3), ("Q", 9))

I have a business requirement to select records based on two fields in one table: code1 and code2. The selection is complex and hard-coded, with no codeable rhy