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].

224,662 questions
0votes
0answers
4views

How to delay execution of extended method until after class is fully loaded

I have the following code: module A def my_method puts self.instance_methods.include?(:my_base_method) end end class B extend A my_method def my_base_method end end ...
0votes
0answers
4views

How to set applicaion fee to zero for reccurring payments using Stripe::Plan API

I have been asked to set up an application fee of zero as per my Client's request. I was successfully able to do it using Stripe:Charge create by simply not passing the application fee. However, with ...
0votes
0answers
12views

Create multiple records with one form submit

I have 3 models: User, Ingredient, and a map of which user has which ingredients - UserIngredient. My current setup works for adding 1 ingredient at a time. What I want is to update the code so that ...
0votes
0answers
10views

Why does Thread#kill prevent new threads from being created and fail silently in Ruby?

After killing a thread, creating new threads seems to fail silently. thread = Thread.new { sleep 1; puts :ok } sleep 2 thread = Thread.new { sleep 1; puts :ok } sleep 2 puts "#2" thread = ...
  • 42.2k
0votes
0answers
14views

Submitting VueJs2 Data to a Ruby Backend

Very basic question here, but I'm struggling to piece together the cleanest method to send information from my frontend to a backend ruby class, which well then use that data (but it will not return ...
0votes
1answer
10views

I am getting a Stripe signature error: #<Stripe::SignatureVerificationError: No signatures found matching the expected signature for payload>

I am currently working on my webhooks and I have an error in my Webhooks controller. This is the error: #<Stripe::SignatureVerificationError: No signatures found matching the expected signature for ...
2votes
0answers
11views

preserve alpha channel when changing resolution in webm vp9 ffmpeg

I am running the streamio-ffmpeg gem in my Ruby code here to operate the FFMPEG command. Setting a Webm with codec VP9 that has alpha transparent frames in it as the input, I want to change the ...
0votes
1answer
18views

testing graphQL mutations on rails using Rspec, resolve returns wrong number of arguments

I'm trying to test graphQL mutations but I couldn't solve the error. I want to create a book for each author # book_type.rb module ApiTypes class BookType < BaseObject field :id, ID, null: ...
1vote
0answers
26views

Call Method in ApplicationController from Gem

I have a Gem that handles authentication of users via a third party, and want to sign in a specific user using Devise, through a method in the Application Controller. I need to pass information about ...
0votes
0answers
9views

I am using open flash chart but getting error in the view page

I am using open flash chart but getting error in the view page swfobject.embedSWF("/open-flash-chart.swf", "flash_content_tfhGcVUM", "880", "450", "9.0.0", "expressInstall.swf",{"data-file":"http%3A%...
0votes
0answers
35views

Share code between specs that are very similar to each other with rspec

Share code between specs that are very similar to each other (ex: a request spec of an action that doesn't do anything other than calling a service object and the spec of the service object itself) I ...
  • 7,460
1vote
0answers
15views

Bundler failed on gem package em-udns -v '0.3.6.2' install

When I am trying to run bundle install on macOs , I got error on An error occurred while installing em-udns (0.3.6.2), and Bundler cannot continue. Make sure that `gem install em-udns -v '0.3.6.2' --...
0votes
1answer
31views

My Delete method is not working, after disabling "Turbo" in rails 7?

I am working on rails 7. I'm trying to run my 'Delete' method after disabling 'Turbo' but its not working, it keeps getting to my 'show.html.erb' file instead of deleting the specific data. Here is my ...
1vote
1answer
44views

Lat/Long coordinate from an imported CSV when parsed to float turns to a 0

I have some lat/long coordinates that i've imported from a CSV file, but for some reason the first latitude value in the file when converted to a float turns to a 0, and Im not sure what to do, ...
1vote
1answer
43views

Unexpected `;` when trying to trim extra endlines

I'm learning how to use erb (and ruby for that matter) and having a hard time replicating examples from this site where the authors demonstrate that you can remove the trailing endline by closing a ...

153050per page