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

Rails.logger not working in ApplicationJob.before_perform

I'm using ActiveJob to manage my jobs, and I have the following ApplicationJob:class ApplicationJob < ActiveJob::Base # [...] before_perform do |job| Rails.logger.info 'before_perform callback...

View Article


SQLite3 "forgets" to use foreign keys

I'm using Ruby with SQLite3 and my attempts to use foreign keys in Sqlite3 were unfortunately not successful. According to sqlite3 --version, version 3.7.13 is installed. As far as I know, Sqlite3...

View Article


(J)Ruby - Is killing a thread okay?

In Java, it's not okay to stop threads. So, I'm wondering whether this (Thread.exit) is okay in Ruby?(FWIW, I'm using JRuby flavour of Ruby)

View Article

ruby - ovirtsdk4 Error during SSO authentication, access_denied: Cannot...

Ruby ovirt-engine-sdk is not working after my mac update. It was working before update and it not working after mac updateCurrent mac version: Sonama - Version 14.6.1I tried installing them gem with...

View Article

Implementation of PBEWithMD5AndDES in Ruby

I'm trying to get a ruby implementation of an encryption lib that's apparently popular in the Java world -- PBEWithMD5AndDES Does anyone know how to use openssl or another open source gem to perform...

View Article


Insert after closing ERB tag with spree/deface

there is a project called TheForeman (v3.3.0) for which I want to override some ERB templates with spree/deface (v1.5.3), for example _managed.html.erb, and add something at the end of it.# in...

View Article

Files with a dot at the beginning are not copied

I use Thor to copy the contents of one folder to another, here is my code:module Generators module App class New < Thor::Group include Thor::Actions desc "Generate a new customer gem structure"...

View Article

Ruby MITM proxy

I'm searching for some examples on how to write a proxy in Ruby that supports HTTPS. I have a simple proxy implemented with Webricks HTTPProxyServer, but I noticed, that HTTPS traffic is just tunneling...

View Article


Cloudflare R2 - Aws::S3::Errors::NoSuchKey (The specified key does not...

I am having an issue when uploading to Cloudflare R2 object storage. I tried using S3, which works well, but I need to set up R2. For uploading I am using gem Shrine.I created a "demo code" that...

View Article


'Error running pod install' while running Flutter app on iOS simulator after...

After I setup my Flutter application with Firebase and connecting the app with the Firebase console, I am not able to run the application in the iOS simulator.My system description is - 2017 Macbook...

View Article

Ruby Koans : Test two different sets of dices who have same values

I am working through the Ruby Koans(A tutorial project of Ruby). In the About_Dice_Project, it's demanded to create a class named DiceSet. I succeed, but there is a interesting question.Here's the code...

View Article

Nokogiri installation error and fails with macOS 14 Sonoma

I am trying to install an older version of nokogiri (1.6.8.1) on a x86 intel mac using Sonoma 14.4 with a ruby project of mine but i am experiencing a problem with either bundle install or gem install...

View Article

How to have Rails migrations run automatically on Heroku

I have more than 10 different Ruby on Rails apps where I have to deploy the same code. I have connected the git repo to my Heroku apps, so whenever I push new changes it deploys on all of them. The...

View Article


size of the record (in bytes) with Activerecord

Is there a simple way to get a size of the record (in terms of the disk space it takes) with activerecord (my db is mysql)?I have found several (1, 2) answers offering a way of doing it with sql, I...

View Article

Redis::TimeoutError: Connection timed out Error -Rails cache

We are using redis(Elasticache) as our cache store.We are experiencing crashes in our app due to redis connection timeout.We have three app servers and use phusion passenger.At the time of crashes...

View Article


Testing file uploads in Rails App using cucumber

I have the following cucumber test in my Rails app with the following step I attach a contract which should basically upload any file to check if upload works (upload is mandatory). Problem: I don't...

View Article

How to add a new attribute to SQS message using Shoryuken before msg moves to...

To add an attribute to SQS msg when an error happens, I have added a custom exception handler.class ShoryukenExceptionHandler extend Shoryuken::Util def self.call(exception, _queue, _sqs_msg) puts...

View Article


bundle install cannot load such file

When I try bundle install or RCT_NEW_ARCH_ENABLED=1 bundle exec pod install in my project I get this error. Mac on chip M2/opt/homebrew/opt/ruby/bin/bundle:25:in `load': cannot load such file --...

View Article

How to close and delete a file in Ruby?

Say that I open a file in Ruby like this:f = File.open('diagram.txt', 'r')Right now, in order to close and delete that file I have this code:begin f = File.open('diagram.txt', 'r')ensure if !f.nil?...

View Article

Using Arel.sql with Arel::Nodes::Case in Ruby for Dynamic subquery

I want to get the timestamp for a table of locations in each rows' local timezone (stored in tz_name column).Generalized, how does one have a dynamic sql call for the timestamp in a given timezone...

View Article
Browsing all 4612 articles
Browse latest View live


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