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

How to efficiently split a large zip file into smaller zips without loading...

I'm working on a Ruby script that needs to split a large zip file into smaller zip files, each of which should be no larger than 20 MB. The original zip file can contain hundreds of thousands of files...

View Article


Parse Thor options outside of class

I would like to parse again some Thor options outside of a Thor class as I have no control on the Thor class and the instance of it. Unfortunately the parse function is not for getting the values out...

View Article


Elastic query "must" does not work correctly

I have a problem with ElasticsearchI want to create a query that will find students in a class with certain skills.For this, I want to use a query with "AND".My query only works correctly if I specify...

View Article

how to convert or format a 0.0 to 0.00 when selecting in postgresql

The value saved in the database is 0.0 as numeric data type, I need to retrieve 0.00 with the select. is there a way in postgres?

View Article

Exclude certain gems from rubygems "gem update" command

I have a gem that I maintain purely for personal use that happens to have a name conflict with an old gem hosted on rubygems.org. When I run gem update, the rubygems.org version is downloaded. I would...

View Article


Installed latest ruby on mac but still showing old in terminal

Installed latest ruby but still showing old versionI have installed latest ruby version on mac ventura and getting success messageSuccessfully installed ruby 3.2.2 into...

View Article

Preventing ActiveRecord migration from making huge changes in db/structure.sql

When running the ActiveRecord migration below on the test (not production) database, large changes in db/structure.sql appear. This is reproducible. The changes are:A small number of the expected...

View Article

What is the most concise way to initialize a Ruby array with at least one...

In Ruby, I have an object that has an array. I want to iterate over the values in the array, but I need there to be at least one item in the array. I know I could do something like this:if...

View Article


Missing Ruby Version on ASDF

I am trying to install Ruby 2.7.7 via asdf but the latest version appears to be 2.7.6. Anyone happen to know how to support a new Ruby version on asdf?Available Ruby 2.7.x versionsTried installing Ruby...

View Article


rswag to generate documentation with and without auth

I have an API that accepts a JWT bearer token. Expected results:token descriptionstatusmessage, if anyvalid token200corrupt token400Your JWT appears to be invalidno token401Did not receive auth...

View Article

Error with ruby version on termux when I try to install metasploit

I was installing metasploit with termux and it said:termux output~ $ ls <br>metasploit-framework storage wiki-termux<br>~ $ cd metasploit-framework<br>~/metasploit-framework $ ruby...

View Article

Get chain of calling rake tasks

Let's say I have a chain of rake taskstaskA --(calls)--> taskB --(calls)--> taskCIs there any way, in the middle of taskC to get the list of invoking rake tasks? I.e. the chain of rake tasks that...

View Article

Ruby array to hash: each element the key and derive value from it

I have an array of strings, and want to make a hash out of it. Each element of the array will be the key, and I want to make the value being computed from that key. Is there a Ruby way of doing...

View Article


ruby reflection - accessing values in an each block

Title is weak as I'm not exactly sure how to describe this one.In Ruby an array can be iterated over, eg (here's a trivial example, but any parameter could be passed[Integer.class, String.class,...

View Article

End of file (EOF) error when delivering an email using Mail_Form gem

I have a simple form set up for a contact object<%= simple_form_for @contact do |f| %><%= f.input :name %><%= f.input :email %><%= f.input :message %><%= f.button :submit...

View Article


Decryption of AES created with sjcl.js in ruby

Hi so lets assume that client-side has a key that is not transfered via the same channel as the encrypted data.What I am trying to accomplish is to decrypt the result of Stanford Javascript Crypto...

View Article

Get names of all files from a folder with Ruby

I want to get all file names from a folder using Ruby.

View Article


How to display numeric value 0.0 as 0.00 in the frontend?

I need that format a numeric value in the frontend. The value saved in the database is 0.0 as numeric data type. I thought there was a way to retrieve it as 0.00 with SELECT. Is this the correct approach?

View Article

Image may be NSFW.
Clik here to view.

failed to install ruby Error running '__rvm_make -j4',

DescriptionUnable to Install Ruby 3.0.2 on Ubuntu 15~22.04.1Steps to reproduceRun rvm install "3.0.2"Expected behaviorRuby is installedActual behaviorError running '__rvm_make -j4',Debug...

View Article

What is the "undef" object of Ruby?

In the MRI implementation of gc.c I saw an object named undef. What is that undef object? What is its class? How can I access it? Is there any utility for it?

View Article
Browsing all 4610 articles
Browse latest View live


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