Quantcast
Channel: Active questions tagged ruby - Stack Overflow
Browsing all 4628 articles
Browse latest View live

VScode Sorbet enable only the LSP, instead of the typecheck

We have a large Ruby on Rails started at ROR version 4 (recently upgraded to ROR 7, with Ruby 3.2.1).-> Now the issue is till date we were using the JetBrains RubyMine with docker-compose setup,...

View Article


Determine file type in Ruby

How does one reliably determine a file's type? File extension analysis is not acceptable. There must be a rubyesque tool similar to the UNIX file(1) command?This is regarding MIME or content type, not...

View Article


RSpec superclass mismatch (Sinatra)

I have several spec files for my Sinatra API.They all have these lines of code:require 'rack/test'require 'json'require_relative '../../../app/main.rb'module MysuperBlog class APIEach spec succeeds but...

View Article

Image may be NSFW.
Clik here to view.

Error running '__rvm_make -j8' in macos Monterey

I'm trying to install ruby 2.7.0 using RVM on MacOS(12.4: apple M2), but i'm getting below error and not able to install required ruby version. I have tried all the solutions available on internet...

View Article

Rails find difference between two dates

I want to calculate how long the user has been a member of my app. I should display it as:User member for 2y, 9mTo do so I've created method inside of User model def member_for #calculate number of...

View Article


How to set port for Rack app?

builder.rb:def app Rack::Builder.new do run App.new end.to_appendHow to run on a given port?

View Article

Stripe.js forwards user to url, but paymentIntent has the status...

I'm setting up a stripe workflow using a stripe.js PaymentElement. The payment is able to clear, and redirect the user to the url given to stripe. However, when the backend queries the status of the...

View Article

VCR not using cassette in rails system test

In the following test:require "application_system_test_case"class ImportTest < ApplicationSystemTestCase test "importing vacancy succeeds" do VCR.use_cassette("import_success", record: :all) do user...

View Article


Root version of ruby not installing in terminal even though rbenv is updated

I'm trying to update my root version of ruby. It seems like the root directory isn't updating. Even with installing ruby through homebrew or with rbenv - ruby will update but running ruby -v continues...

View Article


Ruby/FFI: String not getting to *char function argument

I'm trying to implement with FFI a few functions from the Darknet library:require 'ffi'class Image < FFI::Struct layout :w, :int layout :h, :int layout :c, :int layout :data, :pointerendclass...

View Article

Dry-validation how to allow array of hashes with nil value

This is how I'm trying to allow a nil value for an array of hashes (Im using dry-validations gem)required(:properties).maybe(:array).each(:hash)This is raising the following exception:NoMethodError:...

View Article

possible to determine what this call to super() will be calling

I'm trying to debug an issue and would like to know how I could determine which class this will call to super will be calling...

View Article

Modify column type in Parquet file with ruby (using parquet Gem)

I have a number of Parquet files in our data warehouse. Some of the earlier files ~700 have a Schema type for a column set to string when they should have been int32. Understanding Parquet are...

View Article


No change to website output after updating Rails project

I am attempting to get Rails to output "Hello World" by following the directions in https://guides.rubyonrails.org/getting_started.html. Starting off with an empty Rails project, I run the server and...

View Article

You don't have write permissions for the /var/lib/gems/3.0.0 directory

I want to install sass in my Ubuntu Linux, I'm trying to install it using ruby, but then I got this outputhaphoera@Xubuntu:~$ gem install sass-embeddedERROR: While executing gem ......

View Article


Shopify Inventory Text

I am trying to get our website to display the text "Low stock. Order yours now" if the inventory of the product in question is less than 3.I currently have the following code on the...

View Article

Combine different conditions on a Active Record via Arel

I have a table SubscriberProperty which has columns (name, type, account_id, category, mask, contact , mode )How can i write a Arel condition on the table which takes into account user input like if...

View Article


ruby method to list self keyword arguments

Is there a method that can be called on a method to list the keyword arguments?What I am looking for is something likeself.keyword_argumentsFor example in the following example i am looking for an...

View Article

Image may be NSFW.
Clik here to view.

Ruby 3.2.3 shows large increase in Heroku Free Memory Slots Metric

Previous Ruby Version ‘3.1.4’Updated Ruby Version ‘3.2.3’After Upgrading Ruby to 3.2.3, it is showing a larger variation in the Heroku Free Memory Slots Metric. There is no change in the memory usage...

View Article

How to add filter expressions to a list in Google Analytics Data API (GA4)...

I'm using the google-analytics-data gem to query the GA4 API in a ruby client.When I attempt to add an array of filter expressions to a filter expression list I get an error on line...

View Article
Browsing all 4628 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>